Asp. NET 9 Code Coding specification

Source: Internet
Author: User
Tags variables

Written so long program code, found that a lot of people's code is not standard. In particular, when several people collaborate to develop a project, some people write class names, variable names, methods, and so can not understand the whole project will be able to complete the combination. I think I wrote the code has been very good, at least to see the meaning of the name. However, after reading these 9, I think I have to learn more ...

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!");
}
}       

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.