Updated Style Guide (markdown)

brendandahl 2012-11-06 10:25:30 -08:00
parent 4a6a55f6f2
commit 054cd075f0

@ -10,26 +10,22 @@
* constants - ALL_UPPER_CASE_WITH_UNDERSCORES * constants - ALL_UPPER_CASE_WITH_UNDERSCORES
## Braces ## Braces
* No braces for single line control statements * Always use braces and put them on same line even for single line control statements
```javascript
if (someVar)
return true;
```
* Opening brace on the same line
```javascript ```javascript
if (someVar) { if (someVar) {
someVar += 2; return true;
return someVar; } else {
return null;
} }
``` ```
_Note: This wasn't always followed, but any new code should do this._
## White Space ## White Space
* Space after control statements (if, else, while, for, ...) * Space after control statements (if, else, while, for, ...)
```javascript ```javascript
if (someVar) if (someVar) {
``` ```
## Classes ## Classes