Posted by : Deepak Vasudevan Friday, September 26, 2008

Comment your code ...

For any programmers, it is always strongly recommended to have explicit comments to strategic sections of the code. Commenting a code is very important for many reasons:

  1. It would serve as a valuable memory into what the particular code does. You may not know that down the line, after five years, when you see the code without comments, the same code might sound greek and latin.
  2. A good commented code can easily enable a peer developer to start maintaining it without bothering you for pesky queries on the same.
  3. Where possible, try using summary commenting like in JavaDoc and C# Xml commenting features.

When not to comment?

  1. If you are replacing a logic with another logic, do not comment the older logic and append the new one, as far as possible. That would only serve to increase the file size and complicate the maintainability of the code. To maintain history, use a good Source Control rather.
  2. Avoid explicit and greater detail comments in clientside scripting code like JavaScript which only increases a great pagesize.

Popular Post

Blogger templates

Labels

Blog Archive

Followers

Blog Archive

Powered by Blogger.

- Copyright © Lavanya Deepak -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -