II. C # programming specifications
1. Code Writing rules:
Code Writing rules are something that beginners need to understand. Because we are still young and do not pursue code aesthetics, standards, majors, and logic aesthetics for the time being, we will not be confused into a set. So I don't have to memorize the rules, so I should pay attention to the neat code. Sometimes, the manager or demand reporter needs to explain that the Code is not neat and we cannot find it ourselves. Remember the following:
(1) Remember the shortcut key Ctrl + K + F to help you sort out the selected code automatically. It looks neat;
(2) The project has a long time. It is best to write code in stages at # region, which can help you recall it well;
(3) Remember // This wonderful function process remark method, and reference it as a system original function in the future. Of course, if you still have the // function to write it, it will not be affected if it is not executed, but remember yourself well, but it is not necessary. If you submit the program, you will delete it, so that the boss will not expose the shortcomings of your dependency remarks.
(4) Some rules, multiple interfaces, one line <80, use the computer-generated code as much as possible, use less this, a lot of code should not be placed in try, and so on, I do not remember, it will be summarized in the process of doing so. In fact, you really don't need to read ....
2. Naming rules: This is to cope with the interview. I changed my job three times and interviewed some questions about the basic naming error. install it.
A. Pascal method: for example, namespace, class, and method, each word must start with an uppercase letter: Class classname {}
B. CAMEL: the first letter of the local variable and parameter must not be capitalized. Other first letters must be capitalized: String classnames;
C. The member variables in a class can be prefixed with "_": public class A {public void getclassname () {string _ classname ;}}
D. The interface name prefix is "I": public interface iusernam {}
E. The method uses the dynamic object structure command: public class classname {public void GetUserName {;}}
F. In the program code, define the variables first, and then write the following rows in a concentrated way.
Let's end it here. Today, I came back to see the blog Park and removed what I wrote yesterday from the homepage. I can't say anything. Keep writing. As the leader said, How about talking to you about more demands, how many times have you worked overtime and changed, and finally it is not a template ....
Non-computer-specialized code agriculture C # Study Notes II. C # programming specifications