Skip to content

ATLAS C++ coding guidelines, version 2.1

Scott Snyder (BNL) , Shaun Roe (CERN) , and the former ATLAS Quality Control group

Correspondence to snyder@bnl.gov.

January 1, 2026

Generated from rules.md by pandoc version 3.1.11.1 on January 9, 2026.

This document is also available as PDF and as single-page HTML.

Introduction

This note gives a set of guidelines and recommendations for coding in C++ for the ATLAS experiment.

There are several reasons for maintaining and following a set of programming guidelines. First, by following some rules, one can avoid some common errors and pitfalls in C++ programming, and thus have more reliable code. But even more important: a computer program should not only tell the machine what to do, but it should also tell other people what you want the machine to do. (For much more elaboration on this idea, look up references on “literate programming,” such as  [1].) This is obviously important any time when you have many people working on a given piece of software, and such considerations would naturally lead to code that is easy to read and understand. Think of writing ATLAS code as another form of publication, and take the same care as you would writing up an analysis for colleagues.

This document is derived from the original ATLAS C++ coding standard, ATL-SOFT-2002-001  [2], which was last revised in 2003. This itself derived from work done by the CERN “Project support team” and SPIDER project, as documented in CERN-UCO/1999/207  [3]. These previous guidelines have been significantly revised to take into account the evolution of the C++ language  [4], current practices in ATLAS, and the experience gained over the past decade.

Some additional useful information on C++ programming may be found in the references  [513].

This note is not intended to be a fixed set of rigid rules. Rather, it should evolve as experience warrants.