Naming Convention

All global variables, constants, classes, and enums must be using prefix "cp" to avoid the naming conflict with other libraries. The name must be clear enough to understand, please do not use abreviation if it is not well known.

Class

Class name is started with uppercase for each word.

Style: "cp" + ClassName

Example: 

class cpImageHandler: public wxObject

Macro/define

Macro name are always in uppercase and each word is separated with "_".

Style: "cp" +  MACRONAME1 [+ "_" +  MACRONAME2]

Example:

#define cpMAX_WIDTH 20000

Variable

Class member variables must be have prefix "m_" and  followed by one or more words class name with uppercase first character. Member variables must be as private members.

Style: "m_" + [additional identifier in lower case] + MemberVariable

Example:

Variable as handle should use "h" character: cpImageHandler m_hImage;

Pointer variable can use "p" character: cpCommandBase* m_pCommand;

Pointer

Pointer declaration must stick the "*" character to the  variable type.

Example:

cpCommandBase* m_pCommand; // not cpCommandBase *m_pCommand;

 

Trackback URL for this post:

http://cekli.com/en/trackback/13