Encapsulation
Readability
Naming Conventions
Statements, Braces, Parentheses
Miscellaneous
100

These are labeled with "extern", and should not be used.

What are global variables?

100

4 spaces.

What is the correct indentation for each level?

100

This is the naming convention for variables and static functions.

What is lower-case with underscores?

100

This should be placed between block keywords (such as if or while) and the parentheses.

What is a space?

100

This should be used to get the size of a variable type, rather than hard-coding it.

What is sizeof?

200

These should only include the functions, typedefs, enumerations, etc., that other modules need access to.

What are header files?

200

120 characters.

What is the max line length?

200

This is the naming convention for interface functions.

What is lower-case with underscores, starting with the module name?

200

This can be omitted for the following operators: * % / + -

What are parentheses?

200

The code should compile without these.

What are errors and warnings?

300

These can be placed at the top of a .c file, but better is to structure code so that they are not needed.

What are function prototypes?

300

Avoid these types of comments within a function.

What are block comments?

300

This is the naming convention for #defines and enumerations.

What is upper-case with underscores?

300

This is the amount of spaces that should be indented from a case statement to braces that enclose the case instructions.

What is zero?

300

These constants should be avoided when coding.

What are magic numbers?

400

All functions should be declared with this, unless they need to be otherwise.

What is static?

400

These should be used between operators and after commas.

What are spaces?

400

This is the naming convention for typedefs.

What is underscores, ending with _t?

400

If a break in a switch/case is not necessary, this should be used to indicate it, unless there are no statements between the cases.

What is "//NOBREAK"?

400

The only time when memory can be dynamically allocated.

What is initialization?

500

These should be organized into logically-related groups within a file.

What are functions?

500

These should be used to add information or highlight sections of code, but not to paraphrase code.

What are comments?

500

This is the naming convention for filenames.

What is lower-case with underscores?

500

These are the cases when braces are not needed for if or while blocks.

What is none?

500

This is the root of all evil.

What is premature optimization?

M
e
n
u