A guide for programming in style.
Use Travis to automatically review your GitHub pull requests for style guide violations.
In addition to the general guidelines below, we also have the following more detailed, language/framework-specific style guides:
- Delete trailing whitespace.
- Spell correctly.
- Use spaces around operators, except for unary operators, such as
!
. - Use Unix-style line endings. Github adds these automatically. (
\n
).
- Avoid abbreviations.
- Avoid object types in names (
user_array
,email_method
CalculatorClass
,ReportModule
). - Name variables, methods, and classes to reveal intent.
- Avoid function definitons in the
main
file. Themain
file should be high level and read like English, calling smaller functions which do the heavy lifting. - Order methods so that caller methods are earlier in the file than the methods they call.
- Order methods so that methods are as close as possible to other methods they call.