View on GitHub

SSC Coding Guidelines

General | C++ | Python

C++ Coding Guidelines

Our recommendations for creating and maintaining reliable C++ scientific software.

Good default choices

Here are our suggested default choices for build systems and third party libraries, which are all widely used and well supported:

For each choice there are of course many alternatives, each with their pros and cons, but these represent a sensible default choice for the vast majority of C++ projects.

Our C++ Project Template is a simple way to start a new C++ project with all of the above already set up - just click on the green Use this template button.

If you are looking for more features such as python bindings, or alternative CI or git hosting providers, see our C++ Project Cookiecutter.

Tooling

Good tools make it easier to develop good code. Unlike the previous section, where a single choice must be made for the project, each person contributing to a project can use whichever tools they prefer. Some recommendations:

It is nearly always better, where possible, to use a well tested and maintained third party library instead of rolling your own solution to a problem. Typical benefits include: less bugs, better performance, less maintenance.

Here are our recommendations for third party libraries to solve some common problems in scientific computing: