MySQL Internals Manual  /  ...  /  Naming Conventions

2.1.4 Naming Conventions

  • For identifiers formed from multiple words, separate each component with underscore rather than capitalization. Thus, use my_var instead of myVar or MyVar.

  • Avoid capitalization except for class names; class names should begin with a capital letter.

class Item;
class Query_arena;
class Log_event;
  • Avoid function names, structure elements, or variables that begin or end with '_'.

  • Use long function and variable names in English. This will make your code easier to read for all developers.

  • We used to have the rule: "Structure types are typedef'ed to an all-upper-case identifier." This has been deprecated for C++ code. Do not add typedefs for structs/classes in C++

  • All #define declarations should be in upper case.

#define MY_CONSTANT 15 
  • Enumeration names should begin with enum_.

  • Function declarations (forward declarations) have parameter names in addition to parameter types.

Download this Manual
EPUB - 0.8Mb
User Comments
Sign Up Login You must be logged in to post a comment.