IBM developerWorks has a nice beginners article about how to write code that others (and you, 3 months down the lane) can understand.
The six tips are:
- Comment like a smart person.
- Use #define a lot. No, a LOT.
- Don’t use variable names that will mock you.
- Do error checking. You make errors. Yes, you.
- “Premature optimization is the root of all evil.” – Donald Knuth
- Don’t be too clever by half.
The resources section at the end of the article lists some good food for after thought! If you want to improve your code, go check out the article!
Simple and nice. Was a good reality check !!