... | @@ -12,18 +12,19 @@ |
... | @@ -12,18 +12,19 @@ |
|
2. <strong>Class members naming</strong> member variables: use hungarian notation ```m_``` prefix followed an upper case letter: m_XMLConfig, m_Shape. This method enables easy autocomplete of members in many editors as it's encouraged by the clang-format. Member functions will have the same rules as regular functions (<em>e.g.</em> start with an upper case letter).
|
|
2. <strong>Class members naming</strong> member variables: use hungarian notation ```m_``` prefix followed an upper case letter: m_XMLConfig, m_Shape. This method enables easy autocomplete of members in many editors as it's encouraged by the clang-format. Member functions will have the same rules as regular functions (<em>e.g.</em> start with an upper case letter).
|
|
|
|
|
|
* _Don't_
|
|
* _Don't_
|
|
```cpp
|
|
```cpp
|
|
class Transport
|
|
class Transport
|
|
{
|
|
{
|
|
public:
|
|
public:
|
|
std::string Name;
|
|
std::string Name;
|
|
|
|
```
|
|
* _Do_
|
|
* _Do_
|
|
```cpp
|
|
```cpp
|
|
class Transport
|
|
class Transport
|
|
{
|
|
{
|
|
public:
|
|
public:
|
|
std::string m_Name;
|
|
std::string m_Name;
|
|
|
|
```
|
|
|
|
|
|
3. <strong>Structs:</strong> reserve structs for public member variables only, Structs should not have member functions, derived classes (inheritance), or private members. Structs will be initialized with an upper case letter and member variables won't use hungarian notation (```m_```) as in classes.
|
|
3. <strong>Structs:</strong> reserve structs for public member variables only, Structs should not have member functions, derived classes (inheritance), or private members. Structs will be initialized with an upper case letter and member variables won't use hungarian notation (```m_```) as in classes.
|
|
|
|
|
... | @@ -53,4 +54,4 @@ |
... | @@ -53,4 +54,4 @@ |
|
Exceptions:
|
|
Exceptions:
|
|
* Templates
|
|
* Templates
|
|
* Nested structs (only used a few times)
|
|
* Nested structs (only used a few times)
|
|
* ```enum``` class |
|
* ```enum``` class |
|
|
|
\ No newline at end of file |