Measures Concepts
GitHub icon

Comments

Comments - language feature

< >
Example from Python, Julia, Cython:
# This is a comment
Example from C, C++, Tick C:
/* hello world */ // hi
Example from HTML:
<!-- Hello World in HTML -->
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. =cut
Example from Ruby:
# This is a single line comment.
Example from MATLAB:
% This is a comment
Example from C#, Go:
// This is a comment
Example from Fortran:
C C Lines that begin with 'C' (in the first or 'comment' column) are comments C
-- A comment
# A comment
Example from CSS:
/* This is a single-line comment */ p { color: red; }
Example from Rust:
// https://doc.rust-lang.org/reference/comments.html // a comment
Example from Pascal, ADLIB, Extended Pascal:
{ This is a single line comment in pascal. But needs to be closed. }
Example from Haskell:
-- a single line comment {- A multiline comment which can continue for many lines -}
Example from TypeScript, Objective-C, Solidity, Reason, Yacc, Groovy, OpenCL, Pug, ANTLR, CIL, V, Protocol Buffers, FLUX, BCPL, Hack, DOT, idyll, Fantom, Ballerina, Zephir, Flow, Vala, QML, Click, xBase, Ceylon, JSON5, Java Bytecode, SystemVerilog, HCL, SuperCollider, Bison, POV-Ray SDL, odin, Wren, Dafny, MiniD, ATS, eC, Alloy, PEG.js, Halide, Bicep, Modelica, Objective-J, Clipper, PowerBuilder, Less, AspectJ, XBase++, mlir, Croc, Cue, Eve, Koka, Ron, CIL, Argdown, OpenVera, Taichi, SIL, Objective C++, BETA, Cg, PAWN, Felix, IGOR Pro, P4, JAI, MQL5, Angelscript, LPC, Volt, Rust MIR, beads-lang, JADE, Concise Encoding, Yoix, NetLinx, DM, Linden Scripting Language, Mask, ShaderLab, SugarSS, Whiley, Not Quite C, FutureBASIC, Harbour, mun-lang, CartoCSS, SCSS, Game Maker Language, JSON with Comments, Slice, SimCode, OX, Script.NET, Cell, winxed, Spatial, Strips, MVEL, Cycript, Flow9, Not eXactly C, LoomScript, Type Language, Treelang, Cypher Query Language, Operational Control Language, Fable, Maya Embedded Language, Logos, tht, Vale, gentee, KRL, Q#, dslx, spiral, Rescript, neeilang, hilvl, NS Basic, flagship, Tuple space, Nymph, Jsonnet, Language Server Index Format, Ligo, ddfql, CIR, dlvm, PowerQuery M, DAX, Hocon, holyc, silk, Adventure Game Studio Script, owen-lang, epsilon, HuJSON, kai, CFScript, Sophia, Judoscript, Finite State Language, Soy, StruQL, verifpal, Heron, fizz, OEM, JSL, Lite-C, xxl, Action Code Script, Pnuts, ctalk-lang, OptimJ, sora, rbscript, cooC, Static Typescript:
// A comment
; A comment
Example from Elixir:
# this is a comment
Example from Erlang:
% hello world program
/* A comment */
Example from Dart:
// Hi /* Assume address is not null. */
Example from BASIC:
REM This BASIC program shows the use of the PRINT and GOTO Statements.
Example from OCaml:
(* This is a single-line comment. *) (* This is a * multi-line * comment. *)
Example from SPSS:
* A comment where first character must be *.
Example from XQuery:
(: Hello World with XQuery :)
' A comment
Example from Rexx:
* => 1000000000 */
% A comment
(* A comment *)
Example from HAML:
-# A comment
Example from Object Pascal:
(* This is a multi-line comments and it will span multiple lines. *) { This is a single line comment in pascal }
Example from Ini:
# a '#' or ';' character indicates ; a comment
Example from SNOBOL, Refal, ActiveVFP:
* A comment
Example from Batchfile:
REM A comment :: Another type of comment
Example from TLA:
\* A comment
Example from C3:
// A comment /* Another comment */
! A comment
Example from Wolfram Language:
(* A comment *)
Example from Speedie:
// comment
Example from Twig:
{# A comment #}
Example from HOPE:
--- A comment
Example from Slope:
; I am a comment
Example from Jule:
// A comment /* A comment */
Example from S3:
@ a comment @
Example from groff:
Test \" comment Test Test \# comment Test
Example from Fibonacci:
(* query examples *)
Example from Quaint:
;; A comment
Example from FML:
# This is a line comment ### This is a block comment ###
Example from RELAX NG:
# Comments start with a # and continue to the end of the line:
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 Orc:
{- A comment -}
Example from HAGGIS:
''' A comment '''
Example from Z:
-- A simple function, that is used inside the macro below. defun ap x y ++ x y defmacro : input z:string input -- Example with print: print : Hello, World! What's going on in here?
# <This is a comment>
Example from Mouse:
~ A comment
Example from popr:
__ A comment
Example from dedukti:
(; This is a comment ;)
Example from Lexon:
COMMENT A comment

Languages with Comments include Java, JavaScript, Python, C, SQL, HTML, C++, XML, PHP, Perl, Ruby, MATLAB, C#, Fortran, MySQL, R, Go, COBOL, CSS, Swift, Scala, Ada, Rust, PostgreSQL, Kotlin, PowerShell, Pascal, Haskell, TypeScript, ARM, Lua, Julia, SAS, Clojure, Prolog, Bash, Objective-C, Mathematica, Elixir, Visual Basic, Erlang, CUDA, Scheme, Dart, Modula-2, Solidity, Tcl, ActionScript, VBA, Verilog, Reason, BASIC, Crystal, awk, Delphi, CoffeeScript, F#, YAML, Elm, Maple, Eiffel, OCaml, Modula-3, Racket, Yacc, Smalltalk, D, Sage, Groovy, GraphQL, Common Lisp, LaTeX, VHDL, APL, Smali, Nginx, OpenCL, LLVM IR, SPSS, Nim, XQuery, Visual Basic .NET, PostScript, Pug, Chapel, Red, WebAssembly, Haxe, Rexx, ANTLR, LFE, fish, PureBasic, Forth, MIPS architecture, Lasso, Applescript, VBScript, Idris, Oz, Tex, SVG, Oberon, CIL, V, ABAP, PureScript, Simula, Protocol Buffers, AMPL, PicoLisp, sed, Logo, FLUX, HAML, Processing, BCPL, Dylan, Hack, PL/SQL, REBOL, Nearley, MoonScript, Squirrel, DOT, Terra, idyll, Jison, Monkey, Fantom, J, Ballerina, BlitzBasic, Frege, Agda, EuLisp, ColdFusion, x86 Assembly, Zig, TOML, MUMPS, AutoIt, Hy, Lean, GNU Octave, NewLisp, Emacs Lisp, Zephir, Makefile, Flow, Nemerle, X10, Vala, Icon, Turing, Scilab, QML, PostCSS, Nextflow, Pony, Mercury, PL/I, Click, EDN, Io, xBase, Opa, IDL, Ceylon, JSON5, Boo, QBasic, Java Bytecode, SPARQL, NetLogo, Clean, SystemVerilog, CLIPS, Stata, HCL, Object Pascal, SuperCollider, Factor, Ini, Cython, Bison, API Blueprint, AGC, SNOBOL, POV-Ray SDL, odin, PL/pgSQL, ClojureScript, Wren, Pike, Batchfile, Isabelle, Dafny, TLA, MiniD, ATS, C3, S-algol, Dhall, Lex, Embedded Crystal, eC, Csound, B, Perl 6, Alloy, FoxPRO, Xojo, PEG.js, GW-BASIC, Halide, E, LiveScript, Bicep, Modelica, ECL, AutoHotkey, Objective-J, Clipper, wisp, M4, Datalog, Wolfram Language, Speedie, PowerBuilder, UrWeb, GAP, Gambas, Seed7, Twig, YASnippet, Less, Befunge, XS, PRQL, Cap'n Proto, starlark, Classroom Object Oriented Language, Oberon-2, JFlex, KaTeX, Pig Latin, unison, Transact-SQL, AspectJ, Genie, XBase++, FreeBASIC, SETL, Maxima, Netwide Assembler, Dc, Falcon, DTrace, mlir, Golo, Croc, Bluespec, LiveCode, PEG, Fennel, NSIS, Cue, Ion, WxBasic, Eve, JCL, K, Augmented Backus-Naur Form, Closure Templates, janet, CWL, WDL, True BASIC, SourcePawn, Sather, Koka, datascript, Reia, Ragel, Ron, Xtend, CIL, Argdown, Ren'Py, HLSL, Ring, Hjson, Java Properties, carp, PARI/GP, XSLT, EBNF, Unicon, High Level Assembly, Fortress, muPad, Mirah, Gosu, OpenVera, HOPE, Taichi, SIL, Objective C++, Expect, BETA, Action!, Cg, GLSL, PAWN, Futhark, Felix, PL/M, LilyPond, mgmt, progsbase, IGOR Pro, UNLAMBDA, Slope, Euphoria, QB64, P4, Jule, JAI, Guile, MQL5, NCAR Command Language, Angelscript, LPC, Volt, Dockerfile, Rust MIR, beads-lang, Filebench WML, Spin, Pizza, Bel, KiXtart, Cryptol, JADE, Concise Encoding, blockml, Yoix, Mu, LotusScript, Logica, NetLinx, S3, ThinBasic, BlitzMax, ooc, LookML, Neko, Aldor, Lily, Apex, Nit, Gettext Catalog, DM, clay, OpenSCAD, Linden Scripting Language, Praat Script, GDScript, ARexx, CLOS, Eclipse Command Language, Mask, ShaderLab, ArkScript, PIC, Tea, SugarSS, Whiley, Not Quite C, FutureBASIC, StarOffice Basic, Harbour, carth, Fancy, COMPONENT PASCAL, zephyr-asdl, Joy, mun-lang, CartoCSS, Observable, SCSS, Jasmin, RenderScript, Literate Agda, Ch, Refal, storyscript, Game Maker Language, WebIDL, Edje Data Collection, Turbo Basic, JSON with Comments, PowerBASIC, Slice, SimCode, omega, CLIST, OX, Alpine Abuild, Vigil, BLISS, Script.NET, GCC Machine Description, ActiveVFP, Shen, OpenEdge ABL, C2, spry, Cell, groff, Brightscript, winxed, Spatial, Pan, Strips, MVEL, Cycript, Raku, Flow9, SMT, Caché Basic, Aardvark, Ezhil, Logtalk, SRecode Template, Fibonacci, Not eXactly C, Mary, MAXScript, LoomScript, Creative Basic, Type Language, MOO, Treelang, dex, lispyscript, Opal, Arden syntax, NetRexx, Quaint, Cypher Query Language, Operational Control Language, VHDL-AMS, Fable, FML, Gerbil Scheme, Maya Embedded Language, Logos, Handel-C, Dale, HiveQL, neut, NestedText, tht, monte, Guix Workflow Language, S-PLUS, Lingo, Vale, gentee, MACRO-10, KRL, Q#, basic calculator, XBLite, Plus, Module Management System, turnstile, OCL, dslx, spiral, Xbasic, ACL2, Rc, BitBake, Gentoo Ebuild, PROMAL, Rescript, Simple Actor Language System and Architecture, Grammatical Framework, Parser 3, neeilang, hilvl, NS Basic, RELAX NG, JSLT, Mako, Yet Another Scripting Language, Frink, Gherkin, flagship, Tuple space, Redcode, Nymph, Recfiles, Jsonnet, Orc, Language Server Index Format, Ligo, ddfql, CIR, Parrot BASIC, HAGGIS, Z, dlvm, PowerQuery M, Ren, DAX, Hocon, holyc, silk, Uniform eXchange Format, txr, Zimpl, manool, Boron, Mouse, Claro, Adventure Game Studio Script, C shell, Charity, Pawn, owen-lang, epsilon, GraphQL Schema Definition Language, HuJSON, popr, kai, JS++, CFScript, ldpl, pointless, Sophia, Project Mentat, Judoscript, parasail, Finite State Language, Soy, StruQL, NESL, Augeas, dedukti, Fjölnir, z80, verifpal, Yedalog, Structured Query Reporter, Heron, taf, BuddyScript, fizz, OEM, JSL, Easytrieve, Lite-C, Caché ObjectScript, Atomese, Manchester syntax, FloScript, xxl, Reactive Plan Language, tremor-query, blz, rosette-lang, TAL, Wart, Action Code Script, wah, XPL0, ISETL, Boogie, rbs, Savi, Pnuts, Bla, False, Lexon, Portable Bit Map Format, CLPR, Urbiscript, YAMP, stella, ca65 Assembly, ctalk-lang, Rita, ProbeVue, Plot, Netpbm grayscale image format, RLaB, OptimJ, AmbientTalk, Robots.txt, ppm-format, Amazon Redshift, USD, wescheme, lain, luau, bioscript, sora, SubX, Spice, Sweet Expressions, PromQL, SNOBOL4, KonsolScript, SARL, Oracle Java, boa, Deesel, rbscript, Smithy, PacmanConf, PkgConfig, BABEL, Lighttpd configuration file, Tick C, bawk, cooC, S-Snobol, GAEA, ADLIB, Static Typescript, Extended Pascal, Modula-2+, PL/I-FORMAC, Progol

Languages without Comments include JSON, Regular Expressions, JSONiq, Tree Notation, Superjson, JCOF

This question asks: Does the language have a syntax and support for comments?

Read more about Comments on the web: 1. 2.

HTML of this page generated by Features.ts

View source

- Build the next great programming language · Search · Add Language · Features · Creators · Resources · About · Blog · Acknowledgements · Queries · Stats · Sponsor · Day 605 · feedback@pldb.io · Logout