|
|
@ -1,7 +1,7 @@ |
|
|
|
0. Formatting |
|
|
|
|
|
|
|
a. Use tabs for indentation! |
|
|
|
- 1 tab is 4 spaces wide. |
|
|
|
- tab stops are every 4 characters. |
|
|
|
- One indentation level -> exactly one byte (i.e. a tab character) in the source file. |
|
|
|
b. Line widths: |
|
|
|
- Don't worry about having lines of code > 80-char wide. |
|
|
@ -11,8 +11,9 @@ d. Never place condition bodies on same line as condition. |
|
|
|
e. Space between first paren and keyword, but *not* following first paren or preceeding final paren. |
|
|
|
f. No spaces when fewer than intra-expression three parens together; when three or more, space according to clarity. |
|
|
|
g. No spaces for subscripting. |
|
|
|
h. Space all other operators. |
|
|
|
i. Braces, when used, always have their own lines and are at same indentation level as "parent" scope. |
|
|
|
h. No space before ':' but one after it. |
|
|
|
i. Space all other operators. |
|
|
|
j. Braces, when used, always have their own lines and are at same indentation level as "parent" scope. |
|
|
|
|
|
|
|
(WRONG) |
|
|
|
if( a==b[ i ] ) { printf ("Hello\n"); } |
|
|
|