tisdag 17 maj 2011

Why not how nor what

Here's a quick summary of my career as a programmer.
  1. write working code
  2. don't understand my own code when I return to it later
  3. write lots of comments in my code
  4. still don't understand the code since the comments didn't get updated when code changed
  5. write clearer code and fewer comments
Interestingly one of the 97 things every programmer should know is write plenty of comments while another is write fewer.

Confused? No need to be. Just comment why you've done something a particular way. If you find yourself commenting on what your code does or how then make the code clearer instead.