forked from numenta/nupic.core-legacy
-
Notifications
You must be signed in to change notification settings - Fork 75
Style Guide
breznak edited this page Apr 5, 2019
·
4 revisions
We do not strictly enforce a coding style. Nonetheless all code should be readable by computers as well as humans.
- Use them. Neuroscience is already complicated enough.
- If during a code-review you need to explain something, then you should put your explanation into in-line comments in the source code.
- Code readability over (marginal) optimizations.
- Use spaces, not tabs
- camelCase
- The names of private variables should end with an underscore
_
- C++11 style:
- feel free to use
auto
- prefer
<algorithms>
over for-loops (ie fill) - for sizes use
size_t
- feel free to use
- use
const
where possible (makes reading easier)