.. 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.
Underscores or camelCase?
-------------------------
We use camelCase for function names and underscores for variables names.
For example:
.. code-block:: javascript
function thisIsAFunction () {
let this_is_a_variable;
...
}
const versus let
----------------
Try to use `const` whenever possible. If a variable won't be reassigned, use
`const`, otherwise use `let`.
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