<ol><li><strong>Clang-format:</strong> ADIOS uses the clang-format tool to automatically enforce source code style and formatting rules. There are various ways to integrate the clang-format tool into your IDE / Code Editor depending on if you use Emacs, Vim, Eclipse, KDevelop, Microsoft Visual Studio, etc. that are a bit outside the scope of this document but a quick google search for "integrate clang-format" should point you in the right direction. Main points:<ul><li>Lines no longer than 80 characters.</li><li>Always use braces { and }, even for 1 line <code>if</code> blocks.</li><li>Use 4 spaces for indentation.</li><li>However, you can always reformat the code manually by running:</li><li><prestyle="border: 0;"><code>clang-format -i <aclass="tc-tiddlylink tc-tiddlylink-missing"href="#SourceFile">SourceFile</a>.cpp <aclass="tc-tiddlylink tc-tiddlylink-missing"href="#SourceFile">SourceFile</a>.h</code></pre></li></ul></li><li><strong>Naming:</strong> Use meaningful English words, well-known acronyms (MPI, XML, CFD, GMRES, etc.), or well-known short names (Config, Comm, 2D, 3D).<ul><li>Examples: <strong>timeInitial</strong> instead of <strong>tIni</strong>, or <strong>work</strong> instead of <strong>wrk</strong></li><li>One Exception: when redefining long types with the keyword using some mnemonics and short names is allowed, always document scope. </li><li><prestyle="border: 0;"><code> using std::vector < std::vector << double >> = <strong>vDouble2D;</strong> // local 2D Vector of doubles </code></pre></li></ul></li><li><strong>Underscores:</strong> Avoid underscores "_" in names, adds unnecessary length to the variable name, especially when combined with STL container types, and could conflict with name mangling. Reserve it for prefix of special cases (see class members and lambda functions). Use upper case letters instead.<ul><li><code>Don't</code><prestyle="border: 0;"><code> std::vector < std::vector << double >><strong>this_is_my_very_very_long_two_dimensional_vector_name;</strong></code></pre></li><li><code>Do</code><prestyle="border: 0;"><code> std::vector < std::vector << double >><strong>thisIsMyVeryVeryLongTwoDimensionalVectorName;</strong></code></pre></li></ul></li><li><strong>Using and typedef:</strong> Prefer the keyword using over typedef for readability. Only rename very long complex or custom types, do not rename standard types ( int , double , std::vector ). Prefer including ADIOSTypes.h as it contains fixed types in the std:: namespace uint8_t, uint64_t . <ul><li><code>Don't</code><ul><li><prestyle="border: 0;"><code> typedef std::vector < std::vector < std::map < std::string , double >>><strong>MapIn2DVector;</strong></code></pre></li></ul></li><li><code>Do</code><ul><li><prestyle="border: 0;"><code> using std::vector < std::vector < std::map < std::string , double >>> = <strong>MapIn2DVector;</strong></code></pre></li></ul></li></ul></li></ol>