Looking for sympathy

Started by
7 comments, last by Sol462 17 years, 9 months ago
I've been going over a piece of code for 2 hours only to find that I'd done: if(...); Does stuff like that ever happen to you guys? How can I stop making those dumb mistakes? Thanks.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
Advertisement
Still happens, but less than it used to so best advice is just keep going. You'll never stop making these "trivial" errors but your brain does get better at spotting them with practice.

Some compilers can be set to warn against possible common syntax errors like these, although there is no substitute for making the same mistakes over and over so many times that you stop making them in the first place.
I second what EasilyConfused says. These things are just part of being a programmer. The more you program the less frequent they are. Plus that mistake was actually findable. A lot worse are the ones where one character is wrong and it is something that could be right in another circumstance.
The longer one programs the more one gets into a particular style of programming (the way classes are designed etc.). Then mistakes happen less often because you only change the actual mathematical logic from project to project.

Enough babbling, Im going to bed :)

-CProgrammer
I can offer my worst experience, maybe that can cheer you up =).

I once spent six months debugging som assembler i had written.
I had forgotten an h at a number, so the code overwrote itself. :(

Worst thing with these things is that once you find them, you arent really
happy anyway, just slightly less annoyed...

But as they said, things like that doesnt happen that often after a while.
And most importantly, before you learn to not do them, you quickly learn to look for them.
Ah, we all do that. Out of interest, what compiler are you using? VC 2005 catches that with a warning (On highest warning level, I never use anything lower).
Yeah happens all the time...

A good thing to do (if you can afford it) is to use "code nazi" software like PcLint that that will catch this kind of thing (as well as whole bunch of other anal stuff :) ).
Thanks for the replies!
Evil Steve: I'm using devC++, is that bad? I mean, I have VC++ (the free express version) but I got intimidated by all the options and havn't had time to jump into it, I also had problems with the #include<windows.h> files and other windows programming. Should I change anyway?
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
Quote:Original post by daniel_i_l
Thanks for the replies!
Evil Steve: I'm using devC++, is that bad? I mean, I have VC++ (the free express version) but I got intimidated by all the options and havn't had time to jump into it, I also had problems with the #include<windows.h> files and other windows programming. Should I change anyway?


Add -Wall to the compiler command in dev-c++ to enable all warnings. I belive that would have caught this.
Once (Ok a few times) I spent an entire weekend hunting down what turned out to be a missing semi-colon. At first I thought that I had learned from it, then when I started my internship, do you know what the first mistake that I made was? Yup, a missing semi-colon.
Programming mistakes are quite common. We all have typos or goofs, or when we code whilst not mentally there (i.e. sober). Best thing to do is to find it and fix it. Many people here do it so they won't really hold it against you if they see something like that.
____________________________________Spazuh- Because I've had too much coffee

This topic is closed to new replies.

Advertisement