Coding standards have been discussed before, but perhaps never written down. So, here is
We follow PEP-8, with particular emphasis on the parts about knowing when to be
inconsistent, and readability being the ultimate goal. In addition, we make the following
Line length: comments and documentation comments should follow the 79 character rule,
other lines should be formatted for readability, recognizing the existence of wide screens
and scrollbars (sometimes a 200 character line is more readable, though rarely).
Spacing: whitespace around operators and inside parentheses et al. is okay, particularly
if it helps readability. We are widely inconsistent on this, if the thing inside the
parentheses is short (a single word) often spaces are extraneous, if it is a complex
expression, spacing helps to delineate different parts.
Blank lines: also subjective, the size of the class, number of methods, size of methods,
et cetera all influence what sort of spacing is most readable.
This subjectivity makes it very hard to run a systematic check for spacing and line length
deviations. The more obvious things like tabs used for indentation are bugs.
On Sep 2, 2011, at 4:54 PM, Dave Clements wrote:
I've created a wiki page on coding best practices to record what is actually done,
and the results of discussions like these:
So far, it only lists 2 standards:
1. 4 spaces per indent level
2. Use spaces, not tabs.
I'll continue to watch this list and add best practices accordingly.
Please keep all replies on the list by using "reply all"
in your mail client. To manage your subscriptions to this
and other Galaxy lists, please use the interface at: