Content deleted Content added
Stevebroshar (talk | contribs) →Examples: It's syntax; not typography |
Stevebroshar (talk | contribs) →Examples: Limit examples by grouping by similar syntax |
||
Line 341:
==Examples==
Syntax for comments varies by programming language. There are common patterns used by multiple languages while also a wide range of syntax among the languages in general. To limit the length of this section, some examples are grouped by languages with the same or very similar syntax. Others are for particular languages that have less common syntax.▼
▲Syntax for comments varies by programming language. There are common patterns used by multiple languages while also a wide range of syntax among the languages in general.
====Curly brace languages====
Many of the [[curly brace language]]s such as C, C++ and their many derivatives delimit a line comment with {{code|//}} and a block comment with {{code|/*}} and {{code|*/}}. Originally, C lacked the line comment, but it was added in [[C99]]. The list of languages that use this syntax is long but a few of the more notable include: C, C++, [[C# (programming language)|C#]], [[Java (programming language)|Java]], [[Javascript]]. For example:
<syntaxhighlight lang="c">▼
/*▼
*/▼
bool isOverMaximumProcessLimit() {
// TODO implement
}▼
</syntaxhighlight>▼
===By language===
====Ada====
Line 410 ⟶ 425:
End Sub
End Class
▲</syntaxhighlight>
▲====C====
▲<syntaxhighlight lang="c">
▲ * Check if we are over our maximum process limit, but be sure to
▲ * exclude root. This is needed to make it possible for login and
▲ * than the amount of processes root is running. -- Rik
</syntaxhighlight>
Line 536:
\end{code}
Here more explanation using \LaTeX{} markup
▲ */
▲}
▲/*
</syntaxhighlight>
|