... | ... | @@ -2,16 +2,16 @@ |
|
|
<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><pre style="border: 0;"><code>clang-format -i <a class="tc-tiddlylink tc-tiddlylink-missing" href="#SourceFile">SourceFile</a>.cpp <a class="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>
|
|
|
</ul></li>
|
|
|
<li><pre style="border: 0;"><code>clang-format -i <a class="tc-tiddlylink tc-tiddlylink-missing" href="#SourceFile">SourceFile</a>.cpp <a class="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>
|
|
|
|
|
|
```cpp
|
|
|
// local 2D Vector of doubles
|
|
|
using std::vector<std::vector<double>>; = vDouble2D;
|
|
|
using std::vector<std::vector<double>> = vDouble2D;
|
|
|
```
|
|
|
</ul></li>
|
|
|
|
... | ... | |