The importance of good commenting
October 9th, 2006
We have been working on updating a cool dating website (well at least I think that it is cool
), to make it meet some of the new web 2.0 standards. The project involves revamping the original site, so we have inherited the previous code from the initial developer. I have been trying to do some backwards engineering of the code, to try and figure out how the site works. This is however proving to be quite a task because the previous developer did not put much effort into commenting and there is some quite complex code to sift through.
While I was studying, my programming lecturer always talked about the importance of commenting and he used to subtract marks from projects if the code wasn’t commented correctly. I am now realising how important a simple thing like commenting can be, especially if there are multiple developers working on a project.
I am sure that a vast majority of developers do use comments in their code and I will definetly make sure to use them more appropriately in the future

3 comments on “The importance of good commenting”
01
You are spot on about comments. Some simple comments can go a very long way in helping one understand what the heck is going on. All too often developers don’t think someone else will be picking up the pieces of the code.
Another idea which i’ve come across is implementing some sort of code checking software that actually checks that source code is properly commented amongst other things.
02
Hi,
I agree commenting is invaluable, not only for other people working on projects, but for oneself coming back to a project at a later date.
i am curious though, what are your thoughts on commenting within the mark-up? I used to religiously, but then, discovered that ie 5.5/6 has a bug which duplicates the last character if there is a comment between floated ! So now i try to limit my comments in my mark-up to a bear minimum, if any!
03
Hey there Matt
Thanks for the reply! I have also picked that up. Often when testing, I will just use a comment instead of deleting code and I end up getting so frustrated cause I cannot work out why something isn’t working. Meanwhile the real reason for the error is because ie is reading the commented code as well - poor form!!!
I have also tried to limit the amount of code in my XHTML markup and rather concentrate on having detailed commenting within my php.
At the moment my only advice is to use Firefox and to try and convince the rest of the world that Mozilla is the only way to go
Leave a Reply