Name formula in C ++ program

xiaoxiao2021-03-06  45

(Translated from: http://geosoft.no/development/cppstyle.html 3.1, slightly adapted)

Elmar translation

The words "must" "must" refer to the following conventions, "should" refer to strong recommendation

General naming conventions

3. Represents the name of the type (TYPE) must be written and starts with uppercase letters (ELMAR Note:, for example, the name of the name) 4. The variable name must be modeled to bid and start with lowercase letters 5. Named constants (including enumeration value) ) Must be uppercase letters, inter-word sliding lines 6. Separates the names or functions must be case in combination with cases, starting with lowercase letters 7. Indicates that the names of the name space should be lower. 8. Represent the template type The name should be a capitalization letter Template ... Template ... 9. The thumbnage is not usually written for the name for the name (); // NOT: Exporthtml Source () OpenDvdPlayer (); // NOT: OPENDVDPLAYER (); 10. Global variables should be taken from :: Operator Prefix 11. Private variables of class should add a suffix _ class someclass {private: int lay_;}; 12. General Variables should be used with the same name void settopic (Topic * Topic) // NOT: Void Settopic (Topic * atopic) // NOT: Void Settopic (Topic * x) Void Connect (Database * Database) // NOT: Void Connect (Database * DB) // NOT: Void Connect (Database * ORACLEDB) is a role in a role. These variables can often be named in combination with use and type: Point StartingPoint, CenterPoint; loginname;

13. All names are named in English 14. The scope of the variable should be used with a long name, and the variable in the scope can use a short name. 15. The object's method name should avoid joining the object name because the object name has been implicitly lined.getlength (); // NOT: line.getLineLnelength ();

转载请注明原文地址:https://www.9cbs.com/read-76608.html

New Post(0)