Re: comments (Re: Really Quick Guide to Good HTML)

>>I frequently add comments to my web pages using the syntax
>>
>><!-- This is a comment -->
>>
>>My first few lines are fairly standard giving such information as my name
>>and a version number. I'm quite a bit more sparse with my comments in
>>HTML than I am in, say, C++. I guess I'm still trying to settle on a good
>>commenting style.
>
>Heh, you could always just use your C++ commenting style in a bracket. If I
>did so, mine might possibly look like this:
>
> <!--
>
<big comment snipped>
> -->

The only problem with this is that there are still some browsers out there
that don't properly handle comments, at least if they're in the <body> of
the document.  I had a few snotty little comments in the middle of some of
my web pages just for my own amusement, assuming that most people don't
look at the source.  I was shocked to see the comments rendered as if they
were a part of the page's text when I showed the page to a friend on his
machine.

I figured out that what this browser (and others, I found later) was doing
was terminating the comment sequence at the first line break.  So, while
<!-- hey, this is a comment, jerko -->
would remain invisible,
<!-- hey,
  this is a comment, jerko
-->
would show up as "this is..." in the middle of the page.  I've found at
least two browsers that do this.  My understanding is that this is
nonstandard behavior, but still, I'm keeping all my non-single-line
comments in the <head> from now on.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Ben Breakstone      bbreak@mit.edu
http://hamp.hampshire.edu/~bjbF94/
      For PGP public key,
finger bjbF94@hamp.hampshire.edu

Received on Wednesday, 21 February 1996 16:48:37 UTC