Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common code style guide should be accepted. #7

Open
cyoq opened this issue Mar 17, 2019 · 1 comment
Open

Common code style guide should be accepted. #7

cyoq opened this issue Mar 17, 2019 · 1 comment

Comments

@cyoq
Copy link
Member

cyoq commented Mar 17, 2019

As the source such guides can be taken :

Naming conventions should be also described.

@OlegGedzjuns
Copy link
Member

OlegGedzjuns commented Apr 2, 2019

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

  1. Private variable is written separating each word with an _ and have prefix m_
    type m_variable_name;
  2. Public variable is writen in lowerCamelCase style
    type variableName;
  3. Local variable is written separating each word with an _
    type variable_name
  4. Private and public methodes are writen in UpperCamelCase style
    type MethodeName();
  5. Methode parametere is written separating each word with an _ and with a _ postfix
    type MethodeName( type parameter_name_ );
  6. Class name is writen in UpperCamelCase style
    class ClassName{};
  7. All exit codes, expressions and constants are writen in UPER_CASE and each word is separated with _
    constexpr EXPR_NAME = 0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants