This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
ch02-getting-going.html [2017/08/20 18:15] mithat [Entry points] |
ch02-getting-going.html [2017/08/20 18:18] mithat [Comments] |
||
---|---|---|---|
Line 111: | Line 111: | ||
There are three ways to write comments in Processing: the "standard" comment, the multi line comment, and the doc comment. | There are three ways to write comments in Processing: the "standard" comment, the multi line comment, and the doc comment. | ||
- | === the "standard" comment === | + | === "standard" comments === |
The most common syntax for creating comments in Processing is to use a double forward slash: ''%%//%%''. Anything that comes after a double slash up to the end of the line is a comment and will be ignored by the Processing compiler. Here a version of the ''cranberries2.pde'' program with some added some comments to identify the author and other information and explain some of the code: | The most common syntax for creating comments in Processing is to use a double forward slash: ''%%//%%''. Anything that comes after a double slash up to the end of the line is a comment and will be ignored by the Processing compiler. Here a version of the ''cranberries2.pde'' program with some added some comments to identify the author and other information and explain some of the code: | ||
Line 178: | Line 178: | ||
=== doc comment === | === doc comment === | ||
- | The doc comment is a special case of the multiline comment. It's short for "documentation comment." Its rules and behavior are identical to the multiline comment with one important difference: There is a tool available to Java programs (the platform on which Processing is based) called ''javadoc'' that when applied to a source file will find all the doc comments and produce nicely formatted and pretty documentation. | + | The doc comment is a special case of the multiline comment. It's short for "documentation comment." Its rules and behavior are identical to the multiline comment with one important difference: There is a tool available to Java programs (the platform on which Processing is based) called ''javadoc'' that when applied to a source file will find all the doc comments and produce nicely formatted and pretty documentation from them. |
To turn a mutiline comment into a doc comment, just add an additional ''*'' in the opening tag: | To turn a mutiline comment into a doc comment, just add an additional ''*'' in the opening tag: |