Created
October 17, 2013 20:43
-
-
Save ratherironic/7031874 to your computer and use it in GitHub Desktop.
Question: which of these do you prefer?
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
/* 1: SPACING AFTER 'function' */ | |
// A | |
function throwWaterBalloon(person){ | |
person.isWet = true; | |
} | |
// B | |
function throwWaterBalloon (person){ | |
person.isWet = true; | |
} | |
/* 2: SPACING AFTER '{' */ | |
// A | |
function throwWaterBalloon(person){ | |
person.isWet = true; | |
} | |
// B | |
function throwWaterBalloon(person) { | |
person.isWet = true; | |
} | |
/* 3: SPACING BEFORE + AFTER '( & )' */ | |
// A | |
function throwWaterBalloon(person) { | |
person.isWet = true; | |
} | |
// B | |
function throwWaterBalloon( person ) { | |
person.isWet = true; | |
} |
ABB
When 3 is B it making it easier when you have multiple arguments.
B
B
A
But a space before (
and after )
function throwWaterBalloon (person, size) {
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ABA