Yes Comments

There is more than one way to say it. A rose in any other name is still a rose, or better yet a comment in any other language is still a comment. Every C++ and Java programmer will tell you that end of line comments start with two forward slashes such as:

// This is a C/C++/Java comment.

For some reason, many script languages such as Perl, Ruby, and Jython choose the pound/bang sign for end of line comments.

# This is a script comment.

C inspired languages, such as C++ and Java have comment blocks. Comment blocks start with /* and end with */ and everything in between will be treated as comments such as:

/*
 * This is a C/C++/Java
 *    comment
 *       block
 */

Of course, Java can produce online documentation if you use the /** variation of the comment block. You can also place comments in HTML/XML documents, for example:

<!-- This is an HTML/XML comment -->

If you work with XSLT files, which are just XML files, and want to produce a comment you need to place your comments inside xsl:comment tags, such as:

<xsl:comment>
   This is not a comment.
   This will produce a HTML/XML comment.
</xsl:comment>

And of course, you can comment a JSP page using the HTML comment construct but if that comment is JSP specific and is not supposed to be sent to the client you can use the following comment construct:

<%--
   This is a JSP comment,
      won’t be sent to the client.
--%>

And like everything else that Microsoft does, Visual Basic comments are not based on any of the constructs listed here. Visual Basic end of line comments start with the single quote character. The following is a Visual Basic comment:

' This is a VB comment.

Just remember that developers can speak in code but not everyone that reads your code is a developer. So whatever you’re preferred language is please comment your code, at a minimum fill in the pre/post conditions.