Comment (computer programming): Difference between revisions

Content deleted Content added
BASIC: edit for brevity
Clarify how comments are ignored by a translator yet are parsed by other tools
Line 4:
[[File:CodeCmmt002.svg|thumb|right|300px|[[Java (programming language)|Java]] source code with block comments in <span style="color:#f00;">red</span>, line comments in <span style="color:#0e850e;">green</span> and program code in <span style="color:#00f;"> blue</span>.]]
 
In [[computer programming]], a '''comment''' is text embedded in [[source code]] that a translator ([[compiler]] or [[interpreter (computing)|interpreter]]) ignores. Generally, a comment is an [[annotation]] intended to make the code easier for a [[programmer]] to understand {{endash}} often explaining an aspect that is not readily apparent in the program (non-comment) code.<ref name="PennyGrubb000">{{cite book | last = Penny Grubb | first = Armstrong Takang | title = Software Maintenance: Concepts and Practice | publisher = World Scientific | year = 2003 | isbn = 978-981-238-426-3 | pages = 7, plese start120–121}}</ref> For this article, ''comment'' refers to the same concept in a [[programming languageslanguage]], [[markup language]]s, [[configuration file]]s and any similar context.<ref>{{cite book | last = Ganguli | first = Madhushree | title = Making Use of Jsp | publisher = Wiley | ___location = New York | year = 2002 | isbn = 978-0-471-21974-3 }}, {{cite book | last = Hewitt | first = Eben | title = Java for Coldfusion Developers | publisher = Pearson Education | ___location = Upper Saddle River | year = 2003 | isbn = 978-0-13-046180-3}}</ref> Some [[development tool]]s, other than a source code translator, do [[parse]] comments to provide capabilities such as [[API]] [[documentation generator|document generation]], [[static analysis]], and [[version control]] integration. The [[comparison of programming languages (syntax)#Comments|syntax of comments]] varies by programming language yet there are repeating patterns in the syntax among languages as well as similar aspects related to comment content.
 
The [[comparison of programming languages (syntax)#Comments|syntax of comments]] varies considerably by [[programming language]]. But generally, the flexibility supported by comments allows for a wide degree of content style variability. To promote uniformity, style conventions for their style are commonly part of a [[programming style]] guide. But, [[best practice]]s are disputed and contradictory.<ref name="Dietrich000">{{cite book
Comments can be processed by some [[development tools]] to provide capabilites such as [[API]] [[documentation generator|document generation]], [[static analysis]], and [[version control]] integration.
 
The [[comparison of programming languages (syntax)#Comments|syntax of comments]] varies considerably by [[programming language]]. But generally, the flexibility supported by comments allows for a wide degree of style variability. To promote uniformity, conventions for their style are commonly part of a [[programming style]] guide. But, [[best practice]]s are disputed and contradictory.<ref name="Dietrich000">{{cite book
| last = W. R.
| first = Dietrich