Brackets
When typing anything that requires curly brackets (conditionals, loops, functions, classes, etc), the first bracket goes on the same line as the definition. There is a space between the curly bracket and the end of the definition
BAD:
GOOD:
The second curly bracket will have its own line after the last line of the function
BAD:
GOOD:
EXCEPTION: If a function is empty, it is okay to use {}
syntax on the same line. Remember to put the space!
Each time an opening curly bracket is encountered, indent by an extra tab.
Last updated