The goal of this guide is to help you write source code that is readable, understandable, and maintainable by your peers. If it were possible to achieve this goal through a strict adherence to well-defined rules, there would be no need for this guide.
A good style guide provides guidance, but acknowledges that you and your peers are the ultimate arbiter of what is readable and what is not.
This is the most important rule.
A readable program can always be improved. If it has a syntax error, it can be corrected. If it has bugs, they can be fixed. If it is slow, it can be optimized. If it is insufficient, it can be enhanced.
The less readable a program is, the harder it is to change it. An unreadable program in any language might as well be written in machine code.
Trailing whitespace characters should be deleted. Blank lines should
be empty. Files should end with a single \n
.
Superfluous invisible characters make for noisy diffs.