Forum Moderators: mack

Message Too Old, No Replies

Commenting Question

<!- should these be used -->

         

u4eas

8:05 pm on Apr 5, 2003 (gmt 0)

10+ Year Member



I have just finished building a website and I have started commenting the html like a mad man... I kinda like it, as it gives me easy access to the areas i need to change/fix/etc... I also think it makes the coding look pro just my opinion =)

What I wanted to know is are there any real benefits from comments aside from what I noted above.

What are the disadvantages of them?

Should I use them sparingly?

Thanks in advance!

u4ea

Mohamed_E

9:21 pm on Apr 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Only disadvantage I can think of it that they will increase the size of your page, and so slow downloads on a dialup line. Note that many (I would guess most) people still use dialups!

SEO practioner

11:11 pm on Apr 5, 2003 (gmt 0)

10+ Year Member



I agree with you Mohamed. Same thing here, most people are still on dial-ups.

High-speed internet access is still too young as a technology. The problem we have here is that it's not available in 70% of the localities and the small towns I can think of.

And cable access, depending again where you happen to live, I've heard that if your neighbor downloads tons of MP3's or things like that, he will slow down the whole street!

Meercat

11:52 pm on Apr 5, 2003 (gmt 0)

10+ Year Member



true, but a few characters here and there wont make any difference overall, if you do any server side code this is the best place to put comments as they wont get sent to the browser.

try and add easter eggs to your page in comments ;)

u4eas

12:15 am on Apr 6, 2003 (gmt 0)

10+ Year Member



Cool ok, Ill use sparingly.

As far as easter eggs, what do you mean? (I know what an easter egg is in programing, but I am unsure how you could use this in webdesign.)

Thanks again!

u4ea

griz_fan

3:08 pm on Apr 7, 2003 (gmt 0)

10+ Year Member



I also use quite a few comments, which helps out a lot when you work with others on the same project. One thing I've been doing lately, though, is to replace comments with title and summary attributes when possible. The TABLE tag takes both of this attributes, so I'll use title and summary instead of a comment to describe the table. TD tags can take a title attribute as well (but not summary). I've also been experimenting with replacing comments for forms with the LABEL tag. By doing this, I still get the benefit of a comment, but I'm also making my code a bit more accessible. I just have to make sure that these replacements for the comments use content I'm comfortable with my readers seeing, even though most will not.

Filipe

1:13 am on Apr 8, 2003 (gmt 0)

10+ Year Member



An Easter Egg, like in any software, web or otherwise, is a hidden little treat there for people who go searching for it.

I remember seeing dirty jokes hidden in one site's HTML comments. That's a nice little Easter Egg.

HTML (done properly) can be a LOT easier to read than programming languages, so comments shouldn't be used nearly as much. A good way to work around the need for comments is to have critical portions of your site that normally would need to be commented because it's an endless labrynth of tables and nonsense code is best put into a separate file entirely and included on the server side rather than putting a "<!- Complicated Table Start ->" and "<!- Complicated Table End ->".

Plus, given the amount of work a small few people put into a website, usually comments are unnecessary except where you're doing something really, really obscure.

Some recommend commenting your CSS heavily, but if you have a global CSS file, then cut down page-specific CSS into a separate file included only on the pages that use it, you eliminate the need for that too. Only comment stuff that will be obscure or stuff that is used as a hack.

u4eas

1:49 am on Apr 8, 2003 (gmt 0)

10+ Year Member



thanks 4 the info =)

u4ea