Synopsis: | Write unary, increment, decrement, function call, subscript, and access operators together with their operands; insert spaces around all other operators |
Language: | C# |
Severity Level: | 10 |
Category: | Coding style |
Description: | ||||||||
OPERATORS & OPERANDS Operators are operations that are performed, operands are the arguments or expressions of these operations. E.g. in "int i = (count + 1)":
Depending on the amount of operands it works on, an operator is called:
Next to that an operator can be:
CODING RULES The following style rules apply for the operators in the table below and their operands:
Note: the latter rule does not apply to the binary versions of the '&', '*', '+' and '-' operators. For all other operators (and their operands) these rules do NOT apply !
EXAMPLES a = -- b; // wrong a = --c; // right a = -b - c; // right a = (b1 + b2) + (c1 - c2) + d - e - f; // also fine: make it as readable as possible | ||||||||