Don’t use HTML comments.

<!-- I don't need to be here -->
<p>Lorem ipsum dolor sit amet.</p>

Why not?

  • With modern developer tools, the need to “View Source” is rare today.
  • Developer comments should be secret (HTML comments are visible in the source).
  • Don’t slow down users by making them download invisible comments.


Comments in HTML should always wrapped in backend/templating language, or stripped out during HTML minification. Example:

// GravDept:
// See: Issue 12345
<p>Lorem ipsum dolor sit amet.</p>