11. Programming With Style¶
Readability is very important to programmers, since programs are read and modified far more often then they are written.
We’ve already discussed using Python conventions and introduced the Python style guide, but here is a review of some important conventions you should be using in your code going forward:
- use 4 spaces for indentation
- imports should go at the top of the file
- keep function definitions together in the file (not littered throughout your code)
- keep top level statements, including function calls, together at the bottom of the program, preferably in a
main
function.