Why review code?(为什么要复盘代码)

Posted lixiang12

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Why review code?(为什么要复盘代码)相关的知识,希望对你有一定的参考价值。

  1. The code itself. The most obvious value in code review is often framed in “catching bugs”. (能查出bug)
  2. Macro-level knowledge sharing.When you review other people’s code, you tend to learn new techniques that can benefit you later.(能学到更广泛的技术)
  3. Direction sharing. Relatedly, code review forces you to communicate to teammates what you’re doing, which helps ensure that you don’t end up going in a wrong direction for days or weeks by giving them a chance to push back.(能和同事保持沟通,确保工作方向不跑偏)
  4. Communication practice. Being able to communicate clearly, both within a team and beyond it, is one of the most important skills for succeeding at work.(能练习沟通能力)
  5. Historical record. In my experience, people tend to write much better commit messages when they know someone’s reading them. That’s often useful later when looking back at old changes.(做一些记录也会很有用)
  6. Team cohesion. When you do regular code reviews, work feels a little more like a single team working together instead of each person operating “in their own lane”.(能和团队更密切的配合)
  7. Reading practice. Getting practice reading other people’s code helps you remember how to make your own code more readable. Which leads to better code forever after. (能练习阅读代码的能力,也能让自己代码的可读性更好)

    引自:Sophie Alpert的博客

以上是关于Why review code?(为什么要复盘代码)的主要内容,如果未能解决你的问题,请参考以下文章

我们是怎么做Code Review的

如何有效的做Code Review

如何有效的做Code Review

阿里是如何做Code Review的?

大厂怎么做Code Review?

大厂怎么做Code Review?