Code

Style

The coding style tries to adhere to PEP 8 but cannot do so for the worst rules. The following sections list the deviations and the reasons for them.

Method and function names

All names are written in camel case. Module level names are uppercase, all other names are lowercase.

PEP 8 requires that classes be named in camel case, but all other names be lowercase with words separated by underscore. This is not only horribly inconsequent, but the underscore style is also antiquated and wastes valuable space.

Line length

The line length is 128.

PEP 8 requires lines not to exceed 79 characters, or even 72 in some cases. Well, why not 40 characters? This way, the code would look nice on a 1978’s Commodore PET 2001. Why not 32? Then it would fit a Sinclair ZX80.

Come on, it’s 2013 and 80 characters are too short for today’s software complexity. Even the last generation of punch cards had 96 columns! Nobody is viewing code on a 640x480 VGA screen anymore. You want two code windows side by side? Why not three or four?

The code should be printable in landscape with a 10 point font with line numbers though.

No empty lines in code

In methods and functions, there are no empty lines. This is to make these code blocks stand out as a whole and to avoid having the reader to search for the beginnings. Empty lines in docstrings lessen this effect to some degree, but since docstrings don’t have hiearchical structure and are rendered in a unique way in editors with code colorization, the impression is not disturbed much.