While comments make your HTML easier to maintain, they also can make them slower to load for your users. The ideal solution is to use some type of server-side scripting which strips out comments before they are delivered to your customers' Web browsers. For example, if you use JSP you can use JSP comments that will not display to the user agent:
<%-- comment text --%>
If you are not using a server-side scripting language that strips out the comments, then you should strip them out manually before you deliver them to your Web site.

