.
  • Print
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


Life is 10 percent what you make it, and 90 percent how you take it.

Irving Berlin

Look for:
Webhost
Creative Commons License
Since 2006-07-24
loaded 2008-11-18 23:15:20 • last modified 2008-02-17 12:19:55
Privacy PolicyDisclaimer
• awcfamily.com is powered by PmWiki v.2001944 •
• all content (unless noted otherwise) © 2008 A W Colley
this website and its contents are licensed under the
Creative Commons Attribution-NonCommercial-NoDerivs 2.5 License
Registrar
Valid XHTML 1.0 Transitional