BASIC
Comment type:Line
Comment syntax:REM comment
Snippet:
10 REM This is a comment in BASIC

20 PRINT "Long live Gorilla!"
30 GOTO 20

C
Comment type:Line
Comment syntax:// comment
Snippet:
// This is a C++ style comment, which became valid C syntax in C99.

// This style comment is not supported by K&R C or ANSI C.

C
Comment type:Block
Comment syntax:/* comment */
Snippet:
/* This is a comment */


/* This is
also a
comment */

C Sharp
Comment type:Line
Comment syntax:// comment
Snippet:
// This is a comment

C Sharp
Comment type:Block
Comment syntax:/* This is a comment */
Snippet:
/* This is a comment */


/* This is
also a
comment */

C++
Comment type:Line
Comment syntax:// comment
Snippet:
// This is a comment

C++
Comment type:Block
Comment syntax:/* comment */
Snippet:
/* This is a comment */


/* This is
also a
comment */

ColdFusion
Comment type:Block
Comment syntax:<!--- comment --->
Snippet:
<!--- This is a comment. --->

<cfoutput>
ColdFusion Rocks!<br />
</cfoutput>

CSS
Comment type:Block
Comment syntax:/* comment */
Snippet:
/* This is a comment -- below is MyDiv */

#MyDiv {
width: 100%;
position: fixed;
top: 0;
/* Box Shadow -- this is also a comment */
-moz-box-shadow: 0 0 25px #555;
-webkit-box-shadow: 0 0 25px #555;
box-shadow: 0 0 25px #555;
/* Border Radius -- here is another comment */
-moz-border-radius: 0 0 15 15;
-webkit-border-radius: 0 0 15 15;
border-radius: 0 0 15 15;

Fortran 90
Comment type:Line
Comment syntax:! comment
Snippet:
! this is a comment


PRINT "Fortran!" ! Fortran 90 introduced inline comments.
END

FORTRAN IV
Comment type:Line
Comment syntax:C comment
Snippet:
C Lines that begin with 'C' (in the first column) are comments


WRITE (6,10)
10 FORMAT(12H HELLO WORLD)
END

HTML
Comment type:Block
Comment syntax:<!-- comment -->
Snippet:
<!-- This is a comment -->


<!-- This is
also a
comment -->

Java
Comment type:Line
Comment syntax:// comment
Snippet:
// This is a comment

Java
Comment type:Block
Comment syntax:/* comment */
Snippet:
/* This is a multi

line comment */
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}
}

JavaScript
Comment type:Line
Comment syntax:// comment
Snippet:
<script type="text/javascript">

<!--
document.write("Single line comments!"); // this is a comment
//document.write("This is commented out");
//-->
</script>

JavaScript
Comment type:Block
Comment syntax:/* comment */
Snippet:
<script type="text/javascript">

<!--
document.write("Multi-line comments!");
/*document.write("This is commented out");
document.write("So is this...");*/
//-->
</script>

MATLAB
Comment type:Line
Comment syntax:% comment
Snippet:
% This is a comment

a = 1;
b = 2;
c = 3;
sum = 0;

sum = sum + a;
% sum = sum + b; % this line is commented out
% sum = sum + c; % so is this one

MATLAB
Comment type:Block
Comment syntax:%{ comment %}
Snippet:
% This is a comment

a = 1;
b = 2;
c = 3;
sum = 0;

sum = sum + a;
%{
sum = sum + b; % this line is in the block comment
sum = sum + c; % so is this one
%}

MySQL
Comment type:Line
Comment syntax:# comment
Snippet:
SELECT 1+1;     # This comment continues to the end of line

MySQL
Comment type:Line
Comment syntax:-- comment
Snippet:
SELECT 1+1;     -- This comment continues to the end of line


-- *NOTE:* MySQL double dash comments require a
-- space or control character after the double dashes

MySQL
Comment type:Block
Comment syntax:/* comment */
Snippet:
SELECT 1+

/*
this is a
multiple-line comment
*/
1;

SELECT 1 /* this is an in-line comment */ + 1;

Perl
Comment type:Line
Comment syntax:# comment
Snippet:
# this is a comment

print "Hello world\n"; # this prints a string

PHP
Comment type:Line
Comment syntax:# comment
Snippet:
<?php

echo 'This is a test'; // This is a one-line comment
/* This is a multi line comment
yet another line of comment */
echo 'This is yet another test';
echo 'One Final Test'; # This is a one-line comment
?>

PHP
Comment type:Line
Comment syntax:// comment
Snippet:
// This is a comment

<?php
echo 'This is a test'; // This is also a comment
?>

PHP
Comment type:Block
Comment syntax:/* comment */
Snippet:
<?php

echo 'This is a test'; // This is a one-line comment
/* This is a multi line comment
yet another line of comment */
echo 'This is yet another test';
?>

PostgreSQL
Comment type:Line
Comment syntax:--comment
Snippet:
--this is a comment

select 1; --this returns a resultset of 1

PostgreSQL
Comment type:Block
Comment syntax:/* comment */
Snippet:
/* this is 

a comment */
select 1;

Python
Comment type:Line
Comment syntax:# comment
Snippet:
# this is the first comment

SPAM = 1 # and this is the second comment
# ... and now a third!
STRING = "# This is not a comment."

Ruby
Comment type:Line
Comment syntax:# comment
Snippet:
# this is a comment

puts "Hello world"

Ruby
Comment type:Block
Comment syntax:=begin comment =end
Snippet:
puts "Hello world"

=begin
this is all commented out
and will be ignored
=end
puts "Hello again"

SQL
Comment type:Line
Comment syntax:--comment
Snippet:
--this is a comment

select 1; --this returns a resultset 1

--see MySQL, SQLServer, & PostgreSQL for version specific information

SQL
Comment type:Block
Comment syntax:/* comment */
Snippet:
/* this is 

a comment */
select 1;

/* see MySQL, SQLServer, & PostgreSQL for version specific information */

SQLServer
Comment type:Line
Comment syntax:--comment
Snippet:
--this is a comment

select 1; --this returns a resultset 1
--no space is necessary after the double dashes

SQLServer
Comment type:Block
Comment syntax:/* comment */
Snippet:
/* this is 

a comment */
select 1;