OpenAccess Coding Style Guide and Standards


This document describes the coding standards for OpenAccess 2.2. This reference is for developers who are extending the API. It can also be useful for developers writing an application interface using the OpenAccess API.

Introduction Variables
Names and Naming Conventions     Global Variables
    Filenames     Static Variables
    Class, Structure, and Enum Names     Local Variables
    Global Constant Names     #define Statements
    Macro Names Comments
    In OpenAccess Translators and Utilities    Use C++ Comment Styles
File Structure     Version Information in Comments
    Line Width     Comment Code Blocks
    File Size     Commenting switch, if, and while Blocks
    Indentation and Tabs     Writing Comments For Developers
    Source File Comment Block     Use Proper English
    Separating File Contents into Blocks General Coding Standards
    Header File Structure     Binary Operators
Class, Structure, and Enum Declarations and Definitions     Unary Operators
    Common Coding Standard     Using Casts
    Member Names      . and -> Operators
    Inline Methods     Pointer and Reference Declarations
    Classes or Structs?     Braces
    Static Class Members     if Statements
    Using const     while Statements
Functions     switch Statements
    Function Formatting     for Loops
    Aligning Variable Declarations     do/while Loops
    Function Size     Function Calls
    Breaking Function Content into Blocks     Semicolons to Terminate Statements
    Nesting Classes in Functions     Multi-Line Statements
      Parentheses
    Comparing Pointer and Integral Types     Array Initializers
Best Coding Practices     Signed or Unsigned Declarations?
    Using for Instead of while Statements     Pointers or References?
Base Types     Remove Test Code
Command-Line Help for Command-Line Applications     Compile Time Directives


Return to top of page