[Discussion] Code Review: is it a good idea or a bad idea?

Source: Internet
Author: User
[Discussion] Code Review: is it a good idea or a bad idea? (Original article address) posted on | 4565 views | source csdn | 16 comments |
Author Xia mengzhu programmer review code Abstract:The advantage of code review is that it can help you find bugs and discover errors. developers can share their knowledge in their respective fields to improve quality standards, and provide guidance and learning to enhance the team building capability. The disadvantage is that code review may cause mutual resentment between teams, internal split, and damage the relationship between superiors and subordinates.

Code review is a common topic in software development. Many people think that code review is costly and time-consuming, especially when you send it to the software testing department after BUSY software projects. For some developers, it will lead to more political and gossip in the office.

A code review may gradually improve the Code. If you think that the Code review only slightly improves the software, it is wrong. Developers will work harder if they know their code is evaluated. Therefore, code review is conducive to the mentor system. Programmers will learn more and code review can stimulate team cohesion.

Advantages of code review:

In the opinion of the boss, code review is a good way, and some departments even use peer code review as part of the main process.

  1. Code review can help you find bugs and discover errors;
  2. Developers share their knowledge in their respective fields to help improve quality standards;
  3. Provides guidance and learning for code review;
  4. Strengthen Team building capabilities.

Since there are so many advantages, Why do many developers refuse to perform code reviews? Cultural issues may have become a huge obstacle. Most developers hate code review because they cannot forget the painful review meetings, they are afraid of being criticized and criticized by managers for poor code.

Code review disadvantages:

  1. Code review may also cause mutual resentment and internal split between teams;
  2. The examiner provides false code information;
  3. Developers claim personal encoding standards;
  4. Code review is a task that can disrupt the relationship between superiors and subordinates.

Perhaps the biggest obstacle to code review is fear. Developers are afraid to miss the deadline, be afraid of distractions, and invest too much time.

For any established team, the effectiveness of the Code review is between the two-a friendly silver bullet or a killer by the team. Of course, it also depends on whether your team is willing to actively embrace code review. It is not enough to use any development tool, the premise is that you must make sure that you are using it in the correct way. The author will share ten experiences of efficient code review: 1. code review requires the team to have a good culture; 2. exercise caution when using the issue discovery rate during review as the evaluation standard; 3. control the number of codes for each review; 4. review with questions; 5. all problems and modifications must be confirmed by the original author; 6. use code review to activate individual "initiative". 7. perform code reviews in informal and easy environments; 8. perform self-review before submitting the code and add instructions for the Code. 9. recording notes during implementation can greatly improve the problem discovery rate; 10. use good tools for lightweight code reviews.

After several discussions and reflections, I think the key elements of successful code review are trust and training. Mainly reflected in:

  • The team members must firmly believe that the Code review feedback is not a personal attack or a suspicion of the developer's capabilities;
  • The examiner should believe that, if providing improvement suggestions, the examiner will not hate them;
  • The team should regard viewing code reviews as constructive feedback, rather than grading or criticizing teammates.

Of course, it is inevitable that the team is not completely trustworthy. Correct code review training can help build mutual trust between teams. Now, you can review code by others and leave remarks during code review; instruct new developers to give appropriate feedback, such as learning from experienced developers, they can provide more valuable information; team leaders back up from review and constantly improve and enhance the trust and respect between teams.

Summary:

In my opinion, code review is more important than technology sharing or code sharing. During the review process, problems are discovered and knowledge is disseminated through the explanation of the examiner and the question of the examiner. If you carefully review the code, you can at least let the examiner know what he is doing and how he is doing. If the examiner has done something and has a better solution, we can also share some technical information. At the same time, if the examiner is under review with a large number of issues, the pursuit of technology can also be improved to a certain extent.

In conclusion, Do you think code review is a good idea or a bad idea?

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.