in Ideas Worth Sharing

Six ways to write more comprehensible code

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:

  1. Comment like a smart person.
  2. Use #define a lot. No, a LOT.
  3. Don’t use variable names that will mock you.
  4. Do error checking. You make errors. Yes, you.
  5. “Premature optimization is the root of all evil.” – Donald Knuth
  6. 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!

Write a Comment

Comment