... | ... | @@ -16,19 +16,37 @@ using std::vector<std::vector<double>> = vDouble2D; |
|
|
</li>
|
|
|
</ul>
|
|
|
|
|
|
<li><strong>Avoid underscores:</strong> 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><pre style="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> <pre style="border: 0;"><code> std::vector < std::vector < < double > > <strong>thisIsMyVeryVeryLongTwoDimensionalVectorName;</strong> </code></pre></li></ul></li><li>
|
|
|
<li><strong>Avoid underscores:</strong> adds unnecessary length. Reserve it for prefixes of special cases (see class members and lambda functions). Use upper case letters instead.
|
|
|
<ul>
|
|
|
<li><code>Don't</code>
|
|
|
|
|
|
```cpp
|
|
|
std::vector<std::vector<<double>> this_is_my_very_very_long_two_dimensional_vector_name;
|
|
|
```
|
|
|
</li>
|
|
|
<li><code>Do</code>
|
|
|
|
|
|
```cpp
|
|
|
std::vector<std::vector<<double>> thisIsMyVeryVeryLongTwoDimensionalVectorName;
|
|
|
```
|
|
|
</li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
|
|
|
<strong>Using and typedef keywords:</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 .
|
|
|
<li><strong>Using and typedef keywords:</strong> Prefer the keyword <strong>using</strong> over <strong>typedef</strong> 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>
|
|
|
<li> Don't
|
|
|
|
|
|
```cpp
|
|
|
typedef std::vector<std::vector<std::map<std::string, double>>> MapIn2DVector;
|
|
|
```
|
|
|
</li>
|
|
|
<li>
|
|
|
<li> Do
|
|
|
|
|
|
```cpp
|
|
|
using std::vector<std::vector<std::map<std::string, double>>> = MapIn2DVector;
|
|
|
```
|
|
|
</li>
|
|
|
|
|
|
<li><code>Do</code> <ul><li><pre style="border: 0;"><code> using std::vector < std::vector < std::map < std::string , double > > > = <strong>MapIn2DVector;</strong> </code></pre></li></ul></li></ul></li></ol> |
|
|
\ No newline at end of file |
|
|
</ul>
|
|
|
</li>
|
|
|
</ol> |
|
|
\ No newline at end of file |