Software Development Methodology> Coding standards > Naming conventions

Release Information

Project: Siconos
Internal Release Number: 1.0
Last update: September 15, 2005
Related Documents:


next up previous

Naming conventions

General rules:
  • any identifier has to be a meaningful English sentence, name or acronym.
  • obviously the previous rules does not apply for loop variables than can be single letters.
  • any variable name has to start with a lower case letter.
  • use upper case letter inside multi-words identifier name for each new word. Example: vectorFieldPtr

Specific rules (they prevail over general ones):

  • User-defined types:
    User-defined types include definitions of class, enum, struct and union, as well as the redefined types by typedef. All user-defined type names should start with an upper case letter.
    Example :
    class NonSmoothDynamicalSystem;
  • Constants:
    their identifier has to be in upper case letters and can be prefixed by its owner class name.
    Use the word separator "_".
    Example :
    MODEL_MY_CONSTANT
  • Functions and Methods:
    any function names should start with a lower case letter.
    class member access functions must be prefixed by get or set, following by the member name.
    Example :
    setTime, getTime
  • Boolean functions
    names should begin with keyword is or has.
    Example :
    isTimeOut, hasTime
  • Getters and Setters of pointers must be postfixed by Ptr.
    Example :
    getStateVectorPtr()

next up previous