Language |
In-line Comment |
Block Comment |
Ada, Eiffel, Euphoria, Occam, SPARK, ANSI SQL, ToolBook openscript, and VHDL |
-- InlineComment |
|
ALGOL 60 |
|
comment BlockComment; |
ALGOL 68 |
|
¢ BlockComment ¢
comment BlockComment comment
co BlockComment co
# BlockComment #
£ BlockComment £
|
AppleScript |
-- InlineComment |
(* BlockComment *) |
Assembly language (varies) |
; InlineComment One example (most assembly languages with line comments only) |
|
AutoHotkey |
; InlineComment |
/* BlockComment */ |
AWK, Bash, Bourne shell, C shell, Maple, Python, R, TCL, and Windows PowerShell |
# InlineComment |
<# BlockComment #> |
BASIC (various dialects): |
‘InlineComment (Not all dialects)
REM InlineComment
|
|
C (K&r, ANSI/C89/C90), CHILL, pl/i, and REXX |
|
/* BlockComment */ |
C (C99), C + +, Go, and JavaScript |
// InlineComment |
/* BlockComment */ |
C# |
// InlineComment
/// InlineComment (XML documentation Comment) |
/* BlockComment */
/** BlockComment */ (XML documentation Comment) |
Cobol |
InlineComment (When * was in column 7) |
|
Curl |
|| InlineComment |
|# BlockComment #|
|foo# BlockComment #|
|
Cobra |
# InlineComment |
/# BlockComment #/ (nestable) |
D |
// InlineComment
/// Documentation InlineComment (Ddoc comments) |
/* BlockComment */
/** Documentation BlockComment */ (Ddoc comments)
/+ BlockComment +/ (nestable)
/++ Documentation BlockComment +/ (Nestable, Ddoc comments)
|
DCL |
$! InlineComment |
|
ECMAScript (JavaScript, ActionScript, etc.) |
// InlineComment |
/* BlockComment */ |
Forth |
\ InlineComment |
( BlockComment ) (Single line only)
( before -- after ) Stack Comment Convention
|
FORTRAN 66/77 |
C InlineComment (The letter ' C ' in the first column makes the entire line a comment). |
|
Fortran 90 |
! InlineComment (all characters to the line, from the exclamation mark onwards, is comments) |
|
Haskell |
-- InlineComment |
{- BlockComment -} |
Java |
// InlineComment |
/* BlockComment */
/** BlockComment */ (Javadoc documentation Comment)
|
Lisp and Scheme |
; InlineComment |
#| BlockComment |# |
Lua |
-- InlineComment |
--[==[ BlockComment]==] (variable number of = signs) |
Maple |
# InlineComment |
(* BlockComment *) |
Mathematica |
|
% (* BlockComment *) |
Matlab |
% InlineComment |
%{ BlockComment (nestable) %} Note:both Percent–bracket symbols must is the only non-whitespace characters on their respective lines. |
Object Pascal (Delphi) |
// InlineComment |
(* BlockComment *)
{ BlockComment } |
OCaml |
|
(* BlockComment (* nestable *) *) |
Pascal, Modula-2, Modula-3, Oberon, and ML: |
|
(* BlockComment *) (OCaml comments is nestable) |
Perl and Ruby |
# InlineComment |
=begin BlockComment =cut (POD documentation Comment)
__END__ Comments after end of code
|
Php |
# InlineComment
// InlineComment |
/* BlockComment */
/** Documentation BlockComment */ (PHP Doc comments) |
PILOT |
R:InlineComment |
|
PL/SQL and TSQL |
-- InlineComment |
/* BlockComment */ |
REALbasic |
‘ InlineComment
// InlineComment
rem InlineComment |
|
Sas |
|
* BlockComment;
/* BlockComment */ |
Seed7 |
# InlineComment |
(* BlockComment *) |
Simula |
|
comment BlockComment;
! BlockComment; |
Smalltalk |
|
"BlockComment" |
Smarty |
|
{* BlockComment *} |
Standard ML |
|
(* BlockComment *) |
TeX, LaTeX, PostScript, Erlang, and S-lang |
% InlineComment |
|
Texinfo |
@c InlineComment @comment InlineComment
|
|
TUTOR |
* InlineComment
command $$ InlineComment |
|
Visual Basic |
‘ InlineComment
Rem InlineComment |
|
Visual Basic. NET |
‘ InlineComment
‘‘‘ InlineComment (XML documentation Comment)
Rem InlineComment
|
|
Visual Prolog |
% InlineComment |
/* BlockComment */
|