a reference
See also how to shoot yourself in the foot in various programming languages, programming languages geneology project, programming metanode
Please message me if you have additions or corrections, or if you feel my scope of included "significant" languages is too small
ALGOL:
-
comment (keyword "comment" must be placed at the beginning of a statement) to semicolon;
-
// to end of line
BCPL:
B,
C,
PL/1,
Prolog,
BC,
Calc,
YACC:
-
/* Between these symbols */
C99,
C++,
Objective C,
Java,
Javascript:
-
/* Between these symbols */
-
// to end of line
Shell scripting,
Python,
TCL,
Icon,
Unlambda:
Perl:
-
# to end of line
-
=cut
Everything between a line beginning with an = and a line beginning with =end
=end
Ruby:
-
# to end of line
-
=begin
Everything between a line beginning with =begin and a line beginning with =end
=end
LISP,
Scheme,
LOGO,
Orthogonal,
TinyFugue:
Pascal:
-
{ Between these symbols }
BASIC,
DOS batch file:
QBasic,
Visual Basic,
ASP:
HTML:
-
<!-- Between these symbols -->
Postscript,
Turing:
FORTRAN:
FORTRAN 90:
Forth:
Ada:
-
/* Between these symbols */
-
-- to end of line
Eiffel,
Haskell,
Applescript,
Hypertalk:
Smalltalk,
vim:
COBOL,
SNOBOL,
SPITBOL:
SQL:
ML,
CAML,
SML,
Mathematica,
Modula,
Oberon:
-
(* Between these symbols *)
A/PL:
Javadoc:
-
/** Between these symbols **/
DC:
-
[ Between these symbols ]sd
TECO:
-
! Between these symbols !
Miranda,
Curl:
INTERCAL:
-
Any line containing an odd number of instances of the strings "not" or "n't". (As far as i can tell, anyway-- note, though, that the INTERCAL manual is extremely unclear and i may be misinterpreting it.)
Brainfuck:
-
Brainfuck does not have an explicit comment syntax; however because the interpreter will ignore any input other than the eight one character operators in the brainfuck language
you may just write whatever you like and it will be interpreted as a comment
Original partial source / inspiration for this node was http://s lashdot.o rg/comments.pl?s id=01/04/0 6/1335241&cid=223 .. vast majority but not all of remaining entries came from the infinite 99 Bottles of Beer webpage, which contains many other languages not included here .. thanks to dogbert2 on undernet .. this source disclaimer may or may not be removed from this node eventually