C # Summary of three naming methods commonly used in programming
1. Camel-Type COMMAND: a mix of uppercase and lowercase letters is used to form the name of a variable and a function. Lowercase letters.
2. Pascal naming: A combination of uppercase and lowercase letters is used to form the names of variables and functions. Uppercase letters.
3. Hungary naming method: the variable scope and type are identified by prefixing the variable name with the symbol of the corresponding lower-case letters.
(The Key to the Hungarian naming method is: the identifier name starts with one or more lower-case letters as the prefix; the prefix is followed by a word or a combination of multiple words in the upper-case letters, this word indicates the purpose of the variable. Where, it indicates a member of the class starting with "M)
Instance:
Mydata is a camel name;
Mydata is named after Pascal;
Imydata is a Hungarian name. Its lowercase I indicates its form. The latter name is the same as Pascal's, indicating the purpose of the variable;
Personal suggestion: Do not stick to one form. Use it in combination, take its essence, and discard its dregs:
1. The member fields of the class start with "M _" by using the Hungary name;
2. The class name, method name, and function name are identified by Pascal;
3. Parameters of the method. Local variables use the camel command method;
C # example:
1 Namespace Mycompany. myproject. Test
2 {
3 Class Testprogram
4 {
5 Private Static String M_result = String . Empty;
6
7 Static Void Maintest ( String [] ARGs, Bool Iscomplete)
8 {
9 Int I = 0 ;
10 VaR Filename = " Test.mp4 " ;
11 }
12 }
13 }
1. Camel-Type COMMAND: a mix of uppercase and lowercase letters is used to form the name of a variable and a function. Lowercase letters.
2. Pascal naming: A combination of uppercase and lowercase letters is used to form the names of variables and functions. Uppercase letters.
3. Hungary naming method: the variable scope and type are identified by prefixing the variable name with the symbol of the corresponding lower-case letters.
(The Key to the Hungarian naming method is: the identifier name starts with one or more lower-case letters as the prefix; the prefix is followed by a word or a combination of multiple words in the upper-case letters, this word indicates the purpose of the variable. Where, it indicates a member of the class starting with "M)
Instance:
Mydata is a camel name;
Mydata is named after Pascal;
Imydata is a Hungarian name. Its lowercase I indicates its form. The latter name is the same as Pascal's, indicating the purpose of the variable;
Personal suggestion: Do not stick to one form. Use it in combination, take its essence, and discard its dregs:
1. The member fields of the class start with "M _" by using the Hungary name;
2. The class name, method name, and function name are identified by Pascal;
3. Parameters of the method. Local variables use the camel command method;
C # example:
1 Namespace Mycompany. myproject. Test
2 {
3 Class Testprogram
4 {
5 Private Static String M_result = String . Empty;
6
7 Static Void Maintest ( String [] ARGs, Bool Iscomplete)
8 {
9 Int I =0 ;
10 VaR Filename = " Test.mp4 " ;
11 }
12 }
13 }