# HG changeset patch
# User William Stein <wstein@gmail.com>
# Date 1208217549 25200
# Node ID cb145bf81d00d1c1d5c08b7f0bd6245066d78fe1
# Parent 5f6a72b73b412779b2e13174bce7895fbb84620a
trac #2924 -- programming guide section on style is terrible! (very easy to fix)
diff -r 5f6a72b73b41 -r cb145bf81d00 prog/prog.tex
a
|
b
|
mentioned in this chapter. |
114 | 114 | mentioned in this chapter. |
115 | 115 | |
116 | 116 | \section{Coding Conventions} |
117 | | Follow the standard Python formatting rules when writing code for SciPy, |
| 117 | Follow the standard Python formatting rules when writing code for Sage, |
118 | 118 | as explained at \url{http://www.python.org/doc/essays/styleguide.html}. |
119 | 119 | In particular, |
120 | 120 | \begin{itemize} |
… |
… |
In particular, |
124 | 124 | editors will automatically search/replace leading tabs with 4 |
125 | 125 | spaces. |
126 | 126 | |
127 | | \item Use all lowercase function/class names with underscore separated words: |
| 127 | \item Usually use all lowercase function names with words separated by underscores: |
128 | 128 | \begin{verbatim} |
129 | 129 | def set_some_value() |
130 | 130 | \end{verbatim} |
131 | 131 | instead of: |
132 | 132 | \begin{verbatim} |
133 | | def setSomeValue() |
| 133 | def SetSomeValue() |
134 | 134 | \end{verbatim} |
135 | | There is no differentiation between classes, functions, verbs, |
136 | | nouns, etc. |
| 135 | \item Use CamelCase for class names and major functions that create |
| 136 | objects, e.g., \code{PolynomialRing}. |
137 | 137 | \end{itemize} |
138 | 138 | |
139 | 139 | |