Best Practices
Certain coding conventions are used for a reason. So it's best to use them.
1. Variables and Functions
camelCase or snake_case
function paranthesis don't have whitespace next to the identifier: function()
Variables must be created as close to their first use.
Also camelCase or snake_case for constants. They don't need a different naming scheme. Programmers coming from C are used to UPPER_SNAKE
2. Comments
- at the top of libraries, programs and functions: 1 line WHAT it does
- within libraries, programs and functions: HOW it w
- at statement level, WHY we need to execute this statement (if a statement needs a comment on WHAT it does, it's a badly written statement and needs to be refactored.)
3. Header Files
#ifndef SOME_UNIQUE_NAME_HERE
#define SOME_UNIQUE_NAME_HERE
// your declarations (and certain types of definitions) here
#endif