1. Code Writing Specification:
(1) The code should not only be efficient enough to reduce redundancy, but also be easy for the collaborators to read in order to work more efficiently in the process of cooperation. And the name should try to avoid the ambiguity;
(2) in the process of writing, should develop the habit of writing blank {}, pay attention to the branch;
(3) Underscores are generally used for scopes and variables;
(4) Use Pascal and Camel form to name, distinguish function and variable;
(5) Note should be placed in the function head, try to use only ASCII characters;
2. Code Design Specifications:
(1) function to do one thing;
(2) The program logic is clear and understandable;
(3) Use Assert assert to determine the correct response of the program, if (), else if () to handle possible errors, else for the error test to continue after the operation of the program;
(4) for the simple data type, as far as possible without the class transfer, the application pointer pass;
(5) Public/protected/private members are described in order (do not mix together);
(6) Only if it is necessary to customize the operator, only use type inheritance;
3. Code review:
(1) The most basic method of review in software engineering is peer review. For the critical code, we have to ask more than one person to do the code review.
(2) Review to find errors: coding errors, logic errors, algorithmic errors, potential errors, and regression errors.
Review can also find areas for improvement, familiarity with code, learning knowledge
(3) Code review steps:
"1" by compiling;
"2" Programmer tested the code, you can add OutputDebugString monitoring program flow;
"3" programmers provide the latest code, and file diff analysis Tools (git should now be able to do);
"4" When facing the review, the reviewers actively put forward their views;
"5" to get a satisfactory response to all questions;
"6" Code to consider future updates, maintenance leave room;
After the "7" code review: Correct the obvious error, record the error that cannot be corrected temporarily;
(4) Establish a verification form for code review;
4. Pair Programming:
(1) Pairing programming pay attention to role assignment, role exchange, recording forecast and actual time;
Summarize
In fact, this article is a very good writing standard.
The fourth chapter of software engineering