Friday, January 16, 2009

How to debug in C :-) :-)

After reading this, I'm sure you won't ever have problems debugging again!!!!

1. If at all possible, don't. Let someone else do it.
2. Change majors.
3. Insert/remove blank lines at random spots, re-compile, and execute.
4. Throw holy water on the terminal.
5. Dial 911 and scream.
6. There is rumor that "printf" is useful, but this is probably unfounded.
7. Port everything to CP/M.
8. If it still doesn't work, re-write it in assembler. This won't fix the bug, but it will make sure no one else finds it and makes you look bad.
9. Since you got it to compile, the problem must be in the Other Guys Code.
10. If it's all your code then the problem MUST be in those unreliable Standard Libraries. See '1'.
11. Claim the bug reports are vicious lies meant to tarnish your sterling reputation as a 'C' programmer (well aren't they ?). After all, those who wrote the reports couldn't even read your code. How could they possibly know if there was a bug or not?
12. If they could read your code, review "How to program in C", above.
13. Claim that there wouldn't be a problem if this stingy Company/School/Wife/etc would spring for a copy of C++.

No comments:

Post a Comment