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.

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

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

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: