Construction method reading notes (2)

Recognizing the importance of code specification, code is written for people to read after all. If a person writes code that is not standardized, people who read it will not be able to read it or understand it. When students were asked to read the code before, they would Will complain about my indentation, I now know the importance of specifications, and I will pay attention to the specifications of the code in the future

The code specification is divided into two parts:

1. Code style specification. Mainly the provisions on the text, which seem to be superficial articles, are actually very important.

  Indentation, line width, parentheses, etc. should be standardized, and appropriate comments should be added to explain what the program does, why it does it, and things to pay attention to, otherwise people will not understand your code.

2. Code design specification. It involves general principles of programming, relationships between modules, and design patterns.

 

Code review:

Even the best programmers can't guarantee that there will be no errors. At this time, a code review process is required. Find bugs in code, logic, algorithms, and potential and regression, and spot areas for improvement. Improve your own products to avoid huge mistakes and irreparable losses when users use them.

Code review is to see whether the code has correctly solved the problem within the framework of "code specification", including self-review, peer review, and team review. The most basic review method is peer review.

After the review, the developer should do the following:

1. Correct obvious mistakes

2. Create bugs to record errors that cannot be corrected quickly

3. Write down all your mistakes on one of your own "My Common Mistakes" list as a first step in self-review later

 

Reprinted in: https://www.cnblogs.com/quyangzhangsiyuan/p/11059079.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324187492&siteId=291194637