Thursday 7 April 2011

The Quest for Comments with Practical Information Content

Before you start deleting someone else's useless comments (just because they are not useful) contemplate replacing them with something more useful. Don't just get disenfranchised with comments altogether and dismiss all comments as useless. Comments ARE useful, but have to be written in such a way that they are useful and have practical information content.

The 5-step scale of information content:

1. No comment => no information. The Base Case. Extremely common. Action: read the code and then comment it.
2. Comments without information content, programmer has just written drivel. Surprisingly very common. Action: delete and replace with something more sensible.
3. Comments do have information content, but are useless. Also common. Action: Delete and Replant with something practically useful.
4. Practical information content. Rare. Action: Refine.
5. Practical information content written clearly and concisely. Rare. Action: Enjoy

Remember, when you remove a tree, plant a new one.

No comments: