.. raw:: html
Software Style Guide
====================
Most of the style guide recommendations here come from Douglas Crockford's book
`JavaScript, the good parts `_
Tabs or spaces?
---------------
We always indent 4 spaces. Proper indentation is important for readability.
Underscores or camelCase?
-------------------------
We use camelCase for function names and underscores for variables names.
For example:
.. code-block:: javascript
function thisIsAFunction () {
var this_is_a_variable;
...
}
Spaces around operators
-----------------------
In general, spaces are put around operators, such as the equals ``=`` or plus ``+`` signs.
For example:
.. code-block:: javascript
if (sublocale != locale) {
// do something
}
An exception is when they appear inside for-loop expressions, for example:
.. code-block:: javascript
for (i=0; i