Common code style guide should be accepted.
cyoq opened this issue · comments
As the source such guides can be taken :
- https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md
- https://gist.github.com/lefticus/10191322
Naming conventions should be also described.
All logical parts must be separated by namespaces
namespace name
{
exceptions and EXIT_CODES;
enums;
classes;
}
All clases have same patten
class ClassName
{
// VARIABLES
private :
m_initialized = false;
public :
// CONSTRUCTORS/DESTRUCTORS
public:
ClassName() { Inintialize() };
~ClassName() { Shutdown() };
// METHODES
private :
Inintialize();
Shutdown();
public :
};
Name rules
- Private variable is written separating each word with an _ and have prefix m_
type m_variable_name;
- Public variable is writen in lowerCamelCase style
type variableName;
- Local variable is written separating each word with an _
type variable_name
- Private and public methodes are writen in UpperCamelCase style
type MethodeName();
- Methode parametere is written separating each word with an _ and with a _ postfix
type MethodeName( type parameter_name_ );
- Class name is writen in UpperCamelCase style
class ClassName{};
- All exit codes, expressions and constants are writen in UPER_CASE and each word is separated with _
constexpr EXPR_NAME = 0;