Last active
October 18, 2015 07:02
-
-
Save joyhuang9473/99233653773f4f5b846f to your computer and use it in GitHub Desktop.
Prefer no spaces inside parentheses. The if and else keywords belong on separate lines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (condition) { // no spaces inside parentheses | |
... // 4 space indent. | |
} else if (...) { // The else goes on the same line as the closing brace. | |
... | |
} else { | |
... | |
} | |
// Sort conditional statements may be written on one line if this enhances readability. | |
if (x == kFoo) return new Foo(); | |
// curly braces are required for single-line statements | |
if (condition) { | |
DoSomething(); // 4 space indent. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment