April 6, 2007

Comment your Code

Filed under: Software Design — khangharoth @ 1:21 pm

After three years of Software experience now i am finally able to understand the importance of commenting the code.

And its not for other guys ,its for you also.That more complex is the piece of code in terms of businesses requirements harder it will be for you to understand after say 6 months.

Also while commenting emphasis should not be much on technical details as but more on business requirement.While coding initially you thought some common solution will solve this problem but after getting all the requirements you realized that this is a special case and hence need some weird logic.Document it ,because chances are the everybody else and you also (after 4 months ) will again think why can’t this be done in a simpler way.

I sometime back read somewhere on net

Good programmers comment their code.

Great programmers comment on why they choose a particular implementation.

Master programmers comment on why they didn’t choose other implementations.

This can be a good philosophy for commenting your good.


Blog at