1. Local variable name to be meaningful, as far as possible with the corresponding English name, such as "User name" variable, do not use AA bb cc, etc. to name, but to use username.
2. Do not use a single letter of variables, such as I, N, X, and so on. and to use index, temp and so on. The variable exception for the loop iteration.
3. Pascal nomenclature should be used to name the method name, attribute name, class name, and namespace, and the method name is generally named as the verb-object phrase, as
ShowDialog ();
CreateFile ();
GetPath ();
4. Name The local variables and the parameters of the method using the Camel naming method.
The above several comprehensive examples are as follows
public class Neeke
{
Public Neeke ()
{
}
private string Neekename;
public string Neekename
{
get {return neekename;}
set {neekename = value;}
}
public void CallMe ()
{
System.Console.WriteLine ("Hello neeke!");
}
}
5. Naming WinForm and web spaces using Hungarian nomenclature only, prohibiting the use of default names such as TextBox1, GridView1, etc.
6. Interface naming takes the case I as a prefix, such as Ineeke, to visually differentiate between interfaces and classes.
7. Use the hierarchical structure of namespaces to organize various classes and interfaces.
That's right:
Using Www.Ineeke.Cn;
Namespace ineeke.cn
{
...
}
Error:
Using WWWINEEKECN;
Namespace INEEKECN
{
...
}
8. All code must be guaranteed to have sufficient annotation, the annotation quantity requests above 15%. What you need to annotate includes the following.
1 key statements (such as key variable declarations, conditional judgments, etc.).
2 The document annotation (which begins with//) before the class name includes a simple function description of the class, the usage method, etc.
3 A method with a complex parameter list.
9. Code indentation with the TAB key, do not use the space bar.