流行编程语言及其注释方式一览表
2017-04-06 15:22
676 查看
1.各种编程语言的注释符号比较
2.程语言的注释:
Comment comparisonThere is a wide variety of syntax styles for declaring comments in source code.
BlockCommentin italics is used here to indicate block comment style.
InlineComment
in italics is used here to indicate inline comment style.
Language(编程语言) | In-line comment(行注释) | Block comment(块注释) |
---|---|---|
Ada,Eiffel,Euphoria,Occam,SPARK, ANSI SQL, and VHDL | -- InlineComment | |
ALGOL 60 | comment BlockComment; | |
ALGOL 68 | ¢ BlockComment ¢ comment BlockComment comment co BlockCommentco # BlockComment # £ BlockComment £ | |
AppleScript | -- InlineComment | (* BlockComment *) |
Assembly language (varies) | ; InlineCommentone example (most assembly languages use line comments only) | |
AutoHotkey | ; InlineComment | /* BlockComment */ |
AWK,Bash,Bourne shell, C shell, Maple, 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 * or / is in column 7) *> InlineComment | |
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 as well as multiline) ( 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 on the line, from the exclamation mark onwards, are comments) | |
Haskell | -- InlineComment | {- BlockComment -} |
Java | // InlineComment | /* BlockComment */ /** BlockComment */(Javadoc documentation comment) |
Lisp andScheme | ; InlineComment | #|BlockComment|# |
Lua | -- InlineComment | --[==[ BlockComment]==](variable number of = signs) |
Maple | # InlineComment | (* BlockComment *) |
Mathematica | (* BlockComment *) | |
Matlab | % InlineComment | %{ BlockComment (nestable) %} Note: Both percent–bracket symbols must be 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 *) | |
Perl andRuby | # InlineComment | =begin BlockComment =cut( =endin Ruby) (POD documentation comment) __END__ Comments after end of code |
PHP | # InlineComment // InlineComment | /* BlockComment */ /** Documentation BlockComment */(PHP Doc comments) |
PILOT | R:InlineComment | |
PLZ/SYS | ! BlockComment ! | |
PL/SQL andTSQL | -- InlineComment | /* BlockComment */ |
Python | # InlineComment | '''BlockComment''' """ BlockComment """ (Documentation string when first line of module, class, method, or function) |
Rust | // InlineComment /// InlineComment("Outer" rustdoc comment) //! InlineComment("Inner" rustdoc comment) | /* BlockComment */(nestable) /** BlockComment */("Outer" rustdoc comment) /*! BlockComment */("Inner" rustdoc comment) |
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 */ |
Wolfram Language | (* BlockComment *) | |
Xojo | ' InlineComment // InlineComment rem InlineComment |
https://zh.wikipedia.org/wiki/Template:程序设计语言 https://en.wikipedia.org/w/index.php?title=Comparison_of_programming_languages_(syntax)&action=edit§ion=23
相关文章推荐
- 流行的编程语言及其趋势
- 阐述js的两种注释方式,及其区别?
- 流行编程语言的详细对比(1)--Hello World和注释
- 流行的编程语言及其趋势
- HTML和CSS的注释方式及其作用
- 初学JS作业三:试阐述js的两种注释方式,及其区别
- C++函数的参数及其传递方式学习笔记
- source insight 添加注释快捷方式
- 一个简单的makefile示例及其注释
- JDBC中注册驱动的两种方式及其使用
- poi导出word:包括**普通的段落以及表格**。常用的**api**已经以注释的方式写了进去。
- htm,css,javascript及其他的注释方式
- PHP常用函数及其注释
- HashMap 4种循环遍历方式及其性能对比
- React创建组件的三种方式及其区别
- Linux进程间通信的基本原理、通信方式及其同步方式的理解
- JS、html、css注释方式及作用
- MySQL 语句注释方式简介
- Activity 生命周期及其栈管理方式
- 详解5种跨域方式及其原理