At least in my experience, most of my web applications are not static web pages but dynamic from a scripting engine.
Just curious, does anyone use HTML comments aside from for IE fixes anymore?
|
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.
|
I don't for one reason. It is sent to the client. It may not matter where bandwidth is unlimited but it does matter to people who pay by (M)bytes. |
|||||
|
|
They tend to show up a lot in articles at The Daily WTF. The authors put them in there as jokes for people who know to look at the source... |
|||
|
|
|
In large environments even if you do your optimization devices strip them before they reach the client. |
|||
|
|
|
Yes, I do. Why? Well, because their content is also dynamic and I use it as debug output! |
|||
|
|
|
Sometimes I'll "comment stuff out" when using technologies that don't have server-side-directive comments and accidentally leave it in. Also, sometimes it's helpful when setting up a skeletal site layout for someone to point out stuff like "put your menu items here," or "put your page content here." |
|||
|
|
|
I tend to use server side comments in favour of client-side comments. But that's because my comments can be rather rude and I wouldn't want anyone viewing source and seeing them! :) |
|||||||||
|
|
No I try to avoid it. I will often give a div a rather descriptive id so that if someone is looking for some code they can quickly find it. The main reason why is b/c the comments you write are easily seen by anyone who bothers to view the source. If it's not something the end user should see, don't put it in the HTML comments. |
|||
|
|
|
Yes, I often use them to mark where, for example, banner ad code should be, or other dynamic content, for use in debugging should things not be showing up correctly. The comments, though, dont look like the ones you'd put in source code. They're usually just markers. |
|||
|
|
|
I'll often use them when doing a table or something with a small amount of HTML, and a bunch of repetitive PHP, just to quickly say what's in this column. Usually something small, like `
Bad example, due to just an echo, but it's usually to help visually identify and compartmentalize my code. I have issues reading things if they're too jumbled without something to split them up, like green comments, rather than orange in my PHP :P |
|||
|
|
|
I'll use them if there's something that is potentially unclear. If I'm closing a tag, and the opening of the tag is several screens of code above the closing, I'll often mark that with a comment. If I've done something weird to work around some obscure browser bug, I'll mark that, too. And I'll often use them to mark large sections of the page. (HTML 5 tags are good mojo, but sometimes a nice syntax-highlighted comment makes your HTML easier to grok.) I definitely use fewer HTML comments than CSS comments, or comments in whatever language I'm writing the business logic of the site in. And when I'm working with a templating language, I'll often leave comments in the template that don't get rendered to html, especially if the comment only makes sense if you're looking at the template, rather than the rendered code. |
|||
|
|
|
I might do something like And recently I created a form of which every field was hidden for submitting data to PayPal. Some of the input names are rather odd and non-descriptive, so I included comments which I decided to put as HTML comments so I can read them in either view of the code. |
|||
|
|
|
I use them for giving credits to icon_packs/jquery_codes/css_frameworks/etc authors, when no visible linking is required. Otherwise I use PHP comments. |
|||
|
|
|
I will occasionally use them to indicate the end of a tag:
That's proven useful on occasion, especially if I'm dealing with a lot of templates-inside-templates. Other than that not really. |
|||
|