|Home > Collaboration > Coding Guidelines|
"A major benefit of object-oriented programming languages like C++
is the degree of reuse that can be achieved in well-engineered
systems. A high degree of reuse means that far less code must be
written for each new application; consequently, that is far less
code to maintain." (G.Booch).
Software development distributed in spaceAs an object-oriented toolkit Geant4 is thought to be an integration of components (sets of classes) which are specific to high energy physics (HEP) applications or part of the general foundation class libraries, math libraries (commercial or free) already implemented and distributed world-wide, useful as building blocks for a wide variety of applications. Even within HEP, the reusability of object-oriented software across different laboratories and between different experiments will be essential.
Software development distributed in timeThe first production version of GEANT4 was released in December 1998, after four years of R&D activity. At any time the toolkit may certainly be extended and refined by physicists and experts throughout the world. They may each have used or will use their own coding conventions and rules, which differ from one another. For a world-wide collaboration like GEANT4, it is therefore important not to impose rigid rules or style-conventions, but to maintain flexible and adequate guidelines for programming and coding styles.
"C++ was designed to support data abstraction and object-oriented programming in addition to traditional C programming techniques. It was not meant to force any particular programming style upon all users" (B.Stroustrup).
Programming Guidelines The following guidelines for using the features of the programming language aid adherence to the object-oriented paradigm (data-hiding, encapsulation, etc ...), and promote performance and portability (see Programming Guideline Motivations):