|
Parentheses, brackets and commaUse a space after every comma. Use a space after a begin parenthesis, and a space before an end parenthesis. Do not use such spaces for square brackets. Use one, and only one space between each type. Put pointer * and reference & signs adjacent to the variable they belong to. Use empty lines to group variables and codelines that logically belongs together. Variable names that are grouped this way must be on the same column. Empty lines must be empty, containing no TABs or spaces. If you are unsure of the execution order of an expression, use more than the minimum required number of parentheses and remove them when it becomes more clear. If statements and while loopsNested if statements must use brackets {}. If you have many consecutive if and else if statements, consider using case statements instead, or redesign using a more object oriented approach. If statements and while loops can only execute boolean expressions, never assign or change any data. The next issue of this article will be a bit longer and more advanced, as I'll advance to topics such as naming conventions, functions, classes and namespaces. Comment List
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||