Docsity

ALICE O2 C++ Coding Conventions: Uniformity through Guidelines, Exercises of Communication

Partial preview of the text

Download ALICE O2 C++ Coding Conventions: Uniformity through Guidelines and more Exercises Communication in PDF only on Docsity!

ALICE O^2 C++ coding conventions

Adriana Telesca on behalf of the CWG

March, 21st^2014

CWG

▶ Propose common guidelines, policies and procedures ▶ Conduct surveys for tools that cover the activities of most of the other working groups (aka Support tools) ▶ Coordinate other surveys ▶ Act as a central point where we keep track of who is evaluating what ▶ Ensure that resources are optimized and communication among the working groups is facilitated

Tools, guidelines and procedures

ALICE O^2 C++ coding conventions: why?

▶ O^2 as a fresh start

▶ However, contributions from many coders used to

different conventions

▶ Need to ensure uniformity

▶ Need to adopt common conventions

ALICE O^2 C++ coding conventions: decision

▶ Google C++ coding guidelines as starting point ▶ Widely used conventions taken into account ▶ Herb Sutter and Stroustrup’s guidelines considered ▶ C++11 features

▶ Big effort invested  The result is different from both Google and AliRoot

Coding style

Goal

Coding style

Naming and formatting

Code style

Naming: General

Code style

Naming: Files

Code style

Naming: Functions

Coding style

Formatting: Line length and classes

Coding guidelines

Coding guidelines

▶ Namespaces:

▶ General and std

▶ Scoping:

▶ Variables and Brace initialization ▶ Global variables

▶ Classes:

▶ Initialization

▶ Others:

▶ Exceptions

Highlights

Coding guidelines

Namespaces: using declarations and directives

Coding guidelines

Scoping