Prefer simple instructions over complicated ones, even if that means using more lines or duplicating code.
Avoid one-liners, complicated conditions, language specificities and abstract/generic patterns.
If your code needs to be explained, comment it.. or even better, rewrite it in a simpler way.
Adopt the coding style used in the project you’re contributing to.
This guarantees consistency between your new code and the existing code.
In new projects or new files, do not use tabs. Use 4 space characters instead.
Do not leave trailing spaces in your code.
In Sublime, install the
TrailingSpaces plugin to automatically highlight trailing spaces and give you the option
to easily delete them.
Maximum Line length¶
Fit your code within 120 columns.
If a line of code is longer than 120 characters, break it into two or more lines.
In Sublime, selectto show a ruler.