Comments is an actively used design pattern. Comments generally refer to free text ignored by the compiler that is not part of the language grammar.

?Years Old

Languages without Comments include json

Languages with Comments include abap, acl2, ada, apex, apl, applescript, asymptote, autohotkey, autoit, awk, babel, ballerina, basic, befunge, c, chapel, chuck, clean, clojure, cobol, coffeescript, coldfusion, common-lisp, cpp, d, dart, dedukti, delphi, dylan, e, ecl, edn, eiffel, elixir, elm, erlang, euphoria, f-sharp, factor, falcon, false, fancy, fish, fml-lang, forth, fortran, freebasic, frink, futhark, gambas, gap, genie, go, graphql-sdl, gw-basic, haskell, haxe, idl, ini, io, j, java, javascript, jcl, joy, julia, k, konsolscript, kotlin, lasso, latex, lily, lilypond, lingo, livecode, logo, logtalk, lotusscript, lua, m4, maple, matlab, maxima, maxscript, metafont, mirah, modula-2, modula-3, monte, moo, neko, nemerle, nesl, netrexx, newlisp, nim, nsis, oberon-2, ocaml, octave, openscad, oz, pascal, perl, php, picolisp, pike, postscript, powershell, processing, prolog, purebasic, purescript, python, r, racket, rebol, recfiles, rexx, ring, rlab, ruby, rust, sas, sather, scala, scheme, scilab, seed7, setl, simula, smalltalk, snobol4, sql, squirrel, stata, swift, tcl, turbo-pascal, txr, unlambda, vba, vbscript, verilog, vhdl, xojo, xpl0, xquery, xslt, z-expressions

Example from ballerina:

// A comment

Example from basic:

REM This BASIC program shows the use of the PRINT and GOTO Statements.

Example from c:

/* hello world */
// hi

Example from dart:

// Hi
/* Assume address is not null. */

Example from dedukti:

(; This is a comment ;)

Example from elixir:

# this is a comment

Example from erlang:

% hello world program

Example from fml-lang:

# This is a line comment

This is a block comment

Example from fortran:

C Lines that begin with 'C' (in the first or 'comment' column) are comments

Example from go:

// This is a comment

Example from haskell:

 -- a single line comment
 {- A multiline comment
    which can continue for many lines

Example from ini:

# a '#' or ';' character indicates
; a comment

Example from julia:

# This is a comment

Example from matlab:

% This is a comment

Example from ocaml:

(* This is a single-line comment. *)
(* This is a
 * multi-line
 * comment.

Example from perl:

# This is a comment in perl
=begin comment
This is all part of multiline comment.
You can use as many lines as you like
These comments will be ignored by the 
compiler until the next =cut is encountered.

Example from python:

# This is a comment

Example from recfiles:

# Blah blah…
# Unlike some file formats, comments in recfiles must be complete lines. You cannot start a comment in the middle of a line.

Example from ruby:

# This is a single line comment.

Example from rust:

// a comment

Example from turbo-pascal:

{ within pairs of braces }
(* left parenthesis/asterisk and asterisk/right parenthesis pairs *)
// preceded by two forward slashes

Example from z-expressions:

-- A simple function, that is used inside the macro below.
defun ap x y
     ++ x
defmacro : input
         z:string input
-- Example with print:
print : Hello, World!
        What's going on in here? 

Last updated June 22nd, 2020

Edit Comments on GitHub