Qpid C++ style guide

Qpid C++ follows this guide: http://geosoft.no/development/cppstyle.html

With the following amendments:

  • Rule 34: Qpid source files have .h and .cpp extensions.
  • Rule 71: Qpid uses 4 space indent, not 2. No tabs.
  • Rule 75, 81: Qpid allows (but does not require) else/catch to be on same line as preceeding }
  • Rule 11: Qpid does not add an underscore to member variable names.

And the following additional rules:

  • Rule q1: Unlike other blocks, the contents of namespace blocks are not indented to prevent excessive line splitting, and multiple namespaces may be opened or closed on a single line. For example:
    namespace qpid { namespace common {
    
    class SomeClass {
      void foo();
    };
    
    }} // namespace qpid::common
    

Debate and changes

The discussion on qpid-dev did raise debate about some points of the style guide. The exceptions and new rules above reflect:

  • Points that were agreed on the list.
  • De-facto style of the codebase as it stands today.

Anyone who feels strongly about further modifications to the style guide should:

  1. Raise the issue on qpid-dev.
  2. Get consensus among the active qpid C++ developers for the change.
  3. Reformat the entire qpid codebase to conform to the change.

If you are not willing to do step 3 then don't bother raising the issue.

  • No labels