The Elements of Style for Python Programmers
From 6.00 reference wiki
by Rob Miller
and John Guttag
Good programming isn’t just about getting programs to work correctly – it’s also about writing readable programs. When you write a program, you’re actually communicating to two different audiences. The first is the computer that will run it, which cares about precise syntax and correct operation. The other audience is a person – somebody who wants to read your program, understand how it works, and use it or improve on it. That person may even be you, months or years from now, after you’ve forgotten what you were thinking when you wrote the program. Human readers require lots of help in understanding a formal language – help that you can provide by following a few simple rules.
These rules will help you write programs that are more readable and understandable for people. Although the examples use Python, these rules are generic, applying to any programming language.