Programming Style

Paradigm Development Studios, Copyright 1998



Paradigm Development Studios stives to make their code as readable as possible. Because of this, a standard programming style has been drafted. All of the code from PDS is in the style described herein.

  • No hungarian notation is used -- this is due to the fact that C++ is used and it is felt that C++ has strong enough type checking to do without.
  • All tabs are to be set at four spaces.
  • A line of code cannot exceed eighty spaces.
  • { and } get their own line.
  • All variables and functions are declared in the same style. The first letter of an identifier is always lowercase (e.g., chicken) and the first letter of each subsequent word therein is to be capital (e.g., chickenOfTheSea).
  • Function is split up along several lines. The general format of a function declaration is:

    template <class T>   // If applicable, the template goes first.
    unsigned int32       // Next, the return type.
    theClass::getValue   // The function's name
    (int32 whence)       // Now come the parameters.
    {
        ...
    }

  • Function calls have no spaces between the name and the parameters.
  • All native C++ statements have spaces between the statement and the parentheses. For example, if (...), while (...), etc.
  • C++ style comments (//) are preffered; There is always to be one space after any comment.
  • Parentheses are used with C++ keywords if applicable. Some examples are return, sizeof, etc.
  • Wherever possible, the library's or C++'s own data types are to used. This assists in writing portable code.

<Back to Home>