Next: Building an Opus Installer
Up: Coding Guidelines
Previous: Continuation Lines
Index
- Need to specify naming convention for items in resources; data model.
Note that the resources concept is being replaced by
Traits-based configuration classes. This provides an explicit API
for each configurable class, and avoids many of the problems
associated with the prior use of resources.
- Conventions for throwing exceptions.
- Put all SQL strings into a single or small number of
isolated files, so that it is easier to localize these strings to different
databases.
- Follow the conventions in Python's PEP 290: Code
Migration and Modernization PEP 8
(http://www.python.org/peps/pep-0290.html) For instance, when
searching for a substring, where you don't care about the position of the
substring in the original string, using the in operator makes the meaning
clear, e.g. use
string2 in string1 instead of
string1.find(string2) >= 0 or string1.find(string2) != -1. Also,
when testing dictionary membership, use the 'in' keyword instead of the
'has_key()' method. The result is shorter, more readable and runs faster.
- Follow the conventions in PEP 8: Style Guide for Python Code
PEP 257 (http://www.python.org/peps/pep-0008.html)
- See Python's PEP 257: Docstring Conventions
(http://www.python.org/peps/pep-0257.html).
Next: Building an Opus Installer
Up: Coding Guidelines
Previous: Continuation Lines
Index
info (at) urbansim.org