Preface
Because of the frequent use of C + +, Java, and C # as a development language in development work, the problem of naming conventions often causes me some trouble. On the one hand, there is no single standard answer to the naming code, on the other hand, although the naming of the language is not a fixed form, the style of three languages is not the same, but also each has some unique characteristics. In the process of writing code, the naming method is often changed, and no fixed style is formed. Therefore, according to some data collected from the Internet and some of its own experience, the C + +, Java and C # Naming conventions are summarized to facilitate future inquiries.
Principles of Naming conventions:
L try to adopt the naming rules used before;
L try to use the same naming rules in three languages to facilitate memory;
L try to adopt naming rules from the official (e.g. Sun, MS).
1. Hungarian nomenclature, Camel Nomenclature and Pascal nomenclature
Hungarian nomenclature: Used in Windows programming is very common, proposed by one of Microsoft's Hungarian programmers. The Hungarian nomenclature identifies the scope, type, and so on of the variable by prefixing it with the corresponding lowercase symbol identifier in front of the variable name. For example, M_LPSZSTR represents a long pointer member variable that points to a string ending in 0 characters. Hungarian nomenclature is very awkward to use in object-oriented program design.
Camel nomenclature: Camel-style nomenclature because the name is used to look like Camel hump. There are two forms of camel naming: Mixing uppercase and lowercase letters and underlining between words, such as Runfast and Run_fast, belong to the Camel nomenclature.
Pascal nomenclature: Similar to the Camel nomenclature, but the first letter of Pascal's nomenclature is capital letters.