Home > links, tech > Comments in code

Comments in code

Jeff Atwood has written a good blog post on comments.

Code can only tell you how the program works; comments can tell you why it works. Try not to shortchange your fellow developers in either area.

Practitioners would have noticed these principles long ago; but this post would be a good reading for someone starting programing. Most programing books emphasise the importance of comments, but do not do a good job of explaining how comments should be written. The Practice of Programming has some good advice, but I don’t remember seeing much elsewhere.
The best readable code is the one that does not need any comments. The most useful comments are the ones that explain why the code was written the way it is.

Categories: links, tech
  1. ooopinionsss
    December 3, 2008 at 2:15 pm | #1

    How you think when the economic crisis will end? I wish to make statistics of independent opinions!

  1. No trackbacks yet.