|
Do not use a semicolon as an empty statement [BARE-SEMICOLON: 1 point]
Do not write a bare semicolon anywhere as an empty statement. If you need an empty statement, write { }. Do not write a bare semicolon in between definitions. |
Do not write more than one assignment statement on one line [LINE-PACK: 1 point]
Instead of
x = y+1; y = z;write x = y+1; y = z;You may use chained assignments, as in x = y = 0; |
Do not use a statement that has no effect [NO-EFFECT: 1-3 points]
Do not write a statement such as
x + 1;that does nothing. If you really want to do nothing, use { }. In a for-loop, do not write for(i; i < n; i++) { ... }since the first part of the for-loop heading is i;which is a statement with no effect. |
|