Reprint Address: http://blog.csdn.net/arthur_d/article/details/8263294
First, the Hungarian nomenclature "Hungarian":
Widely used in environments such as Microsoft Windows.
The naming convention for variables (and also macros) used in Windows programming is the Hungarian nomenclature, which is presented by a competent Microsoft programmer Charles Simonyi Charles Simonyi.
The Hungarian nomenclature identifies the scope, type, and so on, by prefixing the variable name with the corresponding lowercase letter symbol identifier. These symbols can be used at the same time, the order is first m_ (member variable), then the pointer, then the simple data type, and so on. For example: M_lpszstr, which represents a long pointer member variable that points to a string that ends with a 0 character.
The key to the Hungarian nomenclature is that the name of the identifier is prefixed with one or more lowercase letters, followed by a word or combinations of words that are capitalized in the first letter, which indicates the purpose of the variable.
Prefix of lowercase letters commonly used in Hungarian nomenclature:
Prefix type
A arrays (array)
b Boolean Value (Boolean)
by Byte (byte)
C signed character (Char)
CB unsigned character (Char Byte, not many people used)
CR Color reference value (COLORREF)
Cx,cy coordinate difference (length shortint)
DW Double Word
fn function
H Handle (handle)
I integral type
L Long int
LP Long Pointer
Members of the M_ class
n short integer (shorter int)
NP near Pointer
P Pointer
S-string
SZ null-terminated string type (string with Zero end)
W Word
Second, the Camel name Law "CamelCase":
Camel-like command, as its name implies, is a mixture of uppercase and lowercase letters to form the names of variables and functions. For example, the following is the same function that is named with the camel-named method and the underscore method, respectively:
Printemployeepaychecks ();
Print_employee_paychecks ();
The first function name uses camel-named notation-each logical breakpoint in the function name is marked with an uppercase letter, and the second function name uses the underscore method----each logical breakpoint in the function name is marked with an underscore.
Camel-style nomenclature has become more popular in recent years, with many new libraries and Microsoft
In an environment like windows, it is used in many proper phases. On the other hand, the underscore is popular after the advent of C, in many of the old Programs and UNIX environment, it is very common use.
Iii. Pascal's nomenclature "Pascalcase":
Similar to the Camel name law. But the camel nomenclature is the first letter lowercase, and the Pascal nomenclature is capitalized
such as: public void
DisplayInfo ();
String UserName;
Both use Pascal's nomenclature.
"In C #, the name of Pascal and the name of the camel are mostly.
In C #, simple variables are generally used in CamelCase rules, while higher-level names use Pascalcase.
Public fields such as the. NET Framework and public properties. 】
Simply put
MyData is an example of a Pascal named.
MyData is a camel-named law.
Imydata is a Hungarian nomenclature that illustrates the type or purpose of a variable.
(above transferred from http://hi.baidu.com/murphy1314/blog/item/7e9283ef55ff8f32adafd55e.html)
===================================================================== CamelCase
I just saw this interesting title today. Spelling of variable names in programs many people have different habits. Basically, the language itself has a style. Like Stringlength,string_length,stringlength. The last one is called Camel-case. The first word is lowercase and the first letter of the following word is capitalized. Cause an effect, like camel hump, Middle High, low on both sides, there is a single peak camel, bimodal camel, multi-peak camel (this seems relatively rare). Microsoft's naming style is the first. But the Hungarian name Mrs. Fremont the variable type as the prefix (lowercase) and the exact same as the camel-case coincidence.
It is said that this writing originated early, but the system of influence may be smalltalk,java and so on.
Before this writing is only limited to the field of procedure, but now its influence slowly penetrate out, a lot of product names have become this style, IMac, XServe, iTunes, hardware software to take such a name for fashion.