Monday, December 18, 2006

Different Types of Comments

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/different_types_of_comments.htm]

Programming enterprise apps and their supporting processes, I've used at several languages. Most of them have different ways to make comments.

Characters Languages Multi-line vs. Single-line Characters
// C#, JavaScript Single 2
/*  */ C#, SQL, CSS Multi 2,2
' VB Single 1
REM DOS Single 3
XML, HTML Multi 4, 3
<%-- --%> ASP.Net Multi 4, 4
-- SQL (single line) Single 2

I didn't have any big dialogue on this, I just found it interesting - 7 different ways to comment code for a set of languages that are often used together for a common goal. I'm sure that someone with a strong Compiler background could explain the significance of multi-line comments vs. single-line comments, and number of characters involved to create the comment identifier.

No comments:

Post a Comment