Coding Standard Template
Coding Standard Template
Reuse Instructions ● Describe how the program is used. Provide the declaration format,
parameter values and types, and parameter limits.
● Provide warnings of illegal values, overflow conditions, or other conditions
that could potentially result in improper operation.
Reuse Example
Identifiers Use descriptive names for all variables, function names, constants, and other
(continued)
Comments ● Document the code so that the reader can understand its operation.
● Comments should explain both the purpose and behavior of the code.
● Comment variable declarations to indicate their purpose.
Good Comment
Bad Comment
Major Sections Precede major program sections by a block comment that describes the
processing that is done in the next section
Example
Blank Spaces ● Write programs with sufficient spacing so they do not appear crowded.
● Separate every program construct with at least one space.
Indenting ● Indent every level of brace from the previous one.
● Open and closing braces should be on lines by themselves and aligned with
each other.
Indenting
Example