Reading Code· I think there is something to be learned from reading code and
· These are excerpts from code that was turned in for Program 2.
· Take Aways:Take Aways:
If code gets too complicated, rethink it
Think defense. Never follow pointers that could be null. If you
remember nothing else today, remember that!!!!
Draw yourself a picture to see all the possible cases. Working 99% of
the time means it is WRONG.
I can teach you how to program well, if you are open to suggestions.
Good variable names makes it easier for the maintainer AND easier
for you. You'll be surprised how clear variable names aid your
USE your return values
Reread your code. What you think of first may not be the clearest