Skip to content


The importance of good commenting

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

Tags: , , .

4 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. 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.

  2. Matt Branthwaite said

    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!

  3. 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 😉

  4. as you may know very well than me these days blogs are cropping up all over the place.most peploe starting such blogs think,they can write anyway and anything on there blog which is definately not true.but your blog solely stands out for your writing style,it is actually quite engrossing.keep at it.

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.