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:
  • // to end of line
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:
  • # to end of line
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:
  • ; to end of line
Pascal:
  • { Between these symbols }
BASIC, DOS batch file:
  • REM to end of line
QBasic, Visual Basic, ASP:
  • ' to end of line
HTML:
  • <!-- Between these symbols -->
Postscript, Turing:
  • % to end of line
FORTRAN:
  • C to end of line
FORTRAN 90:
  • ! to end of line
Forth:
  • \ to end of line
Ada:
  • /* Between these symbols */
  • -- to end of line
Eiffel, Haskell, Applescript, Hypertalk:
  • -- to end of line
Smalltalk, vim:
  • " to end of line
COBOL, SNOBOL, SPITBOL:
  • * to end of line
SQL:
  • remark to end of line
ML, CAML, SML, Mathematica, Modula, Oberon:
  • (* Between these symbols *)
A/PL:
  • @ to end of line
Javadoc:
  • /** Between these symbols **/
DC:
  • [ Between these symbols ]sd
TECO:
  • ! Between these symbols !
Miranda, Curl:
  • || to end of line
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