Avoid implicit or obscure features of the language. And always, say what you mean . Maintain a consistent style throughout a program. Compile with all warnings on, and remove them. If it's constant, declare it const .
Comments Keep code and comments visually separate, e.g., space between code and trailing comments.
It's helpful to line up trailing comments. Use header comments for each file and function. Include the function's purpose, what parms it takes, what it returns, etc. Explain any tricky code. Comments should be an aid to understanding.