.
SoftwareEngineering / C++ Coding Standards

C++ Coding Standards

DRAFT

Basis Documents

Standards

  1. Formatting
    1. Indentation
      1. Tabs shall not be used, ever.
      2. Blocks of code
        1. All lines within a block of code shall be indented at least two spaces more than the containing block of code.
        2. The amount of indentation per block of code shall be consistent within a file.
        3. The braces demarking a block of code, and which are the first non-whitespace character on the line, shall be indented the same as the containing block of code.
      3. Continuation lines of a multi-line statement
        1. Continuation lines shall be indented from the beginning line of the multi-statement by at least twice as much as the amount of indentation per block of code.
        2. All continuation lines for a single statement shall be indented equally.
    2. Spacing
      1. Language keywords shall be separated from the open parenthesis by one space.
      2. There shall not be any whitespace between a function name and its open parenthesis.
      3. If a single space is used after a open parenthesis, a single space shall precede the corresponding close parenthesis.
    3. Naming
      1. Anything specified using #define shall be in all upper case, underscores and numerals may be used.
      2. Anything not specified using #define shall not be in all upper case.
      3. If any member object of a class is prefixed with m_, all member objects of that class shall be prefixed with m_.
      4. Prefixes shall not be used to indicate type.
      5. If any object name includes a prefix indicating scope, all objects in that scope shall have the same prefix.
      6. Variable and function names should be terse, but descriptive.
      7. Names may use underscores and may be CamelCase (the first letter may be upper or lower case).

WORK IN PROGRESS


It were not best that we should all think alike; it is difference of opinion that makes horse races.

Mark Twain
Pudd’nhead Wilson, 1894

A2 Web Hosting
Creative Commons License
GoDaddy
Look for:

loaded 2012-02-04 13:26:29 • last modified 2008-02-17 12:19:55
Privacy PolicyDisclaimer
• awcfamily.com is powered by PmWiki v.2002016 •
• all content (unless otherwise noted) © 2012 A W Colley