HTML commenting : Let’s all do it

I’ve come across this time and time again, and i know i don’t necessarily do this every time, but if you’re working on a complex layout please please please comment your code! It makes future work for yourself, and other developers much easier.

In case it helps, this is the standard i tend to use:

<div id="header">
    <h1>Site Title</h1>
    <p class="subtitle">Subtitle</p>
</div> <!-- @end #header -->

Nice and easy, doesn’t take much time to write and makes scanning through HTML much faster for everyone.

Right, as you were…

This entry was posted in For the financial services industry. Bookmark the permalink.
  • http://twitter.com/Cunningham_UK Alistair Cunningham

    And even more important with PHP as HTML does at least tend to have one specific purpose and follow one broad generic layout (Header -> Body -> Footer)

    • Anonymous

      Actually, most PHP developers nowadays use frameworks that separate the “logic” from the look and feel. That way, you’re not so prone to getting messy php files all over the place. :) #proTip.

  • http://www.colinmcdermott.co.uk/ Colin

    Not meaning to be rude – but capitalise your “i”s! 

    Hard to take the post seriously otherwise… ;)