Presentation is loading. Please wait.

Presentation is loading. Please wait.

ALICE O 2 C++ coding conventions Adriana Telesca on behalf of the CWG2 March, 21 st 2014.

Similar presentations


Presentation on theme: "ALICE O 2 C++ coding conventions Adriana Telesca on behalf of the CWG2 March, 21 st 2014."— Presentation transcript:

1 ALICE O 2 C++ coding conventions Adriana Telesca on behalf of the CWG2 March, 21 st 2014

2 CWG2 ▶ 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 A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 2

3 CWG2 ▶ Adriana: DAQ, AMORE software development ▶ Alina: Offline, Offline software cycle organization ▶ Barth: DAQ, AMORE software development ▶ Ivana: Offline, AliRoot and Geant4 ▶ Matthias: HLT, Vc (SIMD types), Qt/KDE background, C++ committee work ▶ Vasco: DAQ, front-end applications and control software development Members A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 3

4 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 A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 4

5 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 A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 5

6 ALICE O 2 C++ coding conventions Two documents: ▶ Coding style https://atelesca.web.cern.ch/atelesca/naming_formatting/cppguide.xml Git: https://git.cern.ch/web/alice-o2-cwg2.git/shortlog/refs/heads/naming_formattinghttps://git.cern.ch/web/alice-o2-cwg2.git/shortlog/refs/heads/naming_formatting ▶ Naming ▶ Formatting ▶ Comments ▶ Coding guidelines https://atelesca.web.cern.ch/atelesca/coding_guidelines/cppguide.xml Git: https://git.cern.ch/web/alice-o2-cwg2.git/shortlog/refs/heads/coding_guidelineshttps://git.cern.ch/web/alice-o2-cwg2.git/shortlog/refs/heads/coding_guidelines The documents A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 6

7 Coding style Goal A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 7

8 Coding style Naming and formatting A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 8

9 Coding style ▶ Naming ▶ Files ▶ Variables ▶ Functions ▶ Formatting ▶ Line length ▶ Classes Highlights A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 9

10 Code style Naming: General A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 10

11 Code style Naming: Files A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 11

12 Code style Naming: Variables A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 12

13 Code style Naming: Functions A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 13

14 Coding style Formatting: Line length and classes A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 14

15 Coding guidelines Goal A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 15

16 Coding guidelines A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 16

17 Coding guidelines ▶ Namespaces: ▶ General and std ▶ Scoping: ▶ Variables and Brace initialization ▶ Global variables ▶ Classes: ▶ Initialization ▶ Others: ▶ Exceptions Highlights A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 17

18 Coding guidelines Namespaces: general and std A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 18

19 Coding guidelines Namespaces: using declarations and directives A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 19

20 Coding guidelines Scoping A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 20

21 Coding guidelines A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 21

22 Coding guidelines Classes: Initialization A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 22

23 Coding guidelines A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 23

24 Coding guidelines Others A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 24

25 Feedback ▶ Received feedback/questions about: ▶ Templates ▶ STL usage ▶ Exceptions ▶ Threads ▶ Dependencies A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 25

26 Conclusion ▶ Lots of work and dedication ▶ This guide can be adapted following the usage of the C++ language that best suits the needs of the O 2 software. ▶ Your feedback will be considered for the next iterations of the document. A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014 26

27 Questions ? 27 A. Telesca | CWG2 Tools, guidelines and procedures | 21/03/2014


Download ppt "ALICE O 2 C++ coding conventions Adriana Telesca on behalf of the CWG2 March, 21 st 2014."

Similar presentations


Ads by Google