Skip to content

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.

Comments:

  • 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.

Python Coders should be familiar with the pep-8 style guide:

C++ code:

  • 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
  • use const where possible (makes reading easier)
Clone this wiki locally