Why this matters
Declaring multiple variables in one statement reduces readability and increases the risk of errors, especially when initializing complex objects.
Ensure that each variable is declared separately instead of using multiple declarations in one statement.
Declaring multiple variables in one statement reduces readability and increases the risk of errors, especially when initializing complex objects.
Side-by-side examples engineers can pattern-match during review.
int a, b, c;int a;
int b;
int c;int a, b, c;int a;
int b;
int c;From the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.