# Coding guidelines

The basic principles of developing Brian are:

1. For the user, the emphasis is on making the package flexible, readable and easy to use. See the paper “The Brian simulator” in Frontiers in Neuroscience for more details.

2. For the developer, the emphasis is on keeping the package maintainable by a small number of people. To this end, we use stable, well maintained, existing open source packages whenever possible, rather than writing our own code.

- Development workflow
  - The repository structure
  - Implementing a feature/fixing a bug
  - Useful links
- Coding conventions
  - General recommendations
  - String formatting
  - Commits only changing the style
- Representing Brian objects
  - `__repr__` and `__str__`
  - LaTeX representations with sympy
  - Representations for ipython
- Defensive programming
- Documentation
  - Docstrings
- Logging
  - Log level recommendations
  - Testing log messages
  - Logging in extension packages
- Testing
  - Running the test suite
  - Writing tests