Page 96 - Build Your Own Quadcopter_ Power Up Your Designs with the Parallax Elev-8
P. 96
Chapter 4: Prog ramming the P arallax Propeller Chip 75
Comment Symbology Purpose
{ …comments… } Multiline code comments (one curly brace pair)
{{ …comments… }} Multiline documentation comments (two curly brace pairs)
‘ …comments… Single-line code comment (one apostrophe)
‘’ …comments… Multiline documentation comments (two apostrophes)
Table 4.1 PST Comment and Documentation Symbols
The Blinker1 program shown in the editor portion of Figure 4.5 contains three sections:
1. Comments/Documentation
2. OBJ
3. PUB
The first section, Comments/Documentation, contains the program name along with
any comments and/or explanations of what the program is supposed to do and how it
works. I strongly believe that comments are a very important part of any program—even
those that you write only for your own use. It is easy to imagine that you could create an
uncommented program, put it aside, return to it six months later, and then not have any idea
as to the function of the program. I really feel so strongly about this subject that I will not
even grade any of my students’ programs unless they contain comments.
The PST provides several means for adding comments to the source code. These are
shown in Table 4.1. The PST uses document comment symbols to determine if a comment or
a set of comments are to be shown in the Documentation View. Figure 4.6 is the Documentation
View of the Blinker1 program.
Figure 4.6 Blinker1 documentation view.