The primary purpose of code review is to make sure that the overall code health of Google’s code base is improving over time. All of the tools and processes of code review are designed to this end.

In order to accomplish this, a series of trade-offs have to be balanced.

First, developers must be able to make progress on their tasks. If you never submit an improvement to the codebase, then the codebase never improves. Also, if a reviewer makes it very difficult for any change to go in, then developers are disincentivized to make improvements in the future.

On the other hand, it is the duty of the reviewer to make sure that each CL is of such a quality that the overall code health of their codebase is not decreasing as time goes on. This can be tricky, because often, codebases degrade through small decreases in code health over time, especially when a team is under significant time constraints and they feel that they have to take shortcuts in order to accomplish their goals.

Also, a reviewer has ownership and responsibility over the code they are reviewing. They want to ensure that the codebase stays consistent, maintainable, and all of the other things mentioned in “What to look for in a code review.”

Thus, we get the following rule as the standard we expect in code reviews:

In general, reviewers should favor approving a CL once it is in a state where it definitely improves the overall code health of the system being worked on, even if the CL isn’t perfect.

That is the senior principle among all of the code review guidelines.

There are limitations to this, of course. For example, if a CL adds a feature that the reviewer doesn’t want in their system, then the reviewer can certainly deny approval even if the code is well-designed.

0919-The Standard of Code Review的更多相关文章

  1. 我们是怎么做Code Review的

    前几天看了<Code Review 程序员的寄望与哀伤>,想到我们团队开展Code Review也有2年了,结果还算比较满意,有些经验应该可以和大家一起分享.探讨.我们为什么要推行Code ...

  2. Code Review 程序员的寄望与哀伤

    一个程序员,他写完了代码,在测试环境通过了测试,然后他把它发布到了线上生产环境,但很快就发现在生产环境上出了问题,有潜在的 bug. 事后分析,是生产环境的一些微妙差异,使得这种 bug 场景在线下测 ...

  3. Git和Code Review流程

    Code Review流程1.根据开发任务,建立git分支, 分支名称模式为feature/任务名,比如关于API相关的一项任务,建立分支feature/api.git checkout -b fea ...

  4. 如何搭建开源code review gerrit服务器

    搭建环境:Ubuntu 14.04 一.环境准备 1.Java环境 gerrit依赖,用于安装gerrit环境. 下载:jdk-7u79-linux-x64.tar.gz http://www.ora ...

  5. Code Review Tools

    Code Review中文应该译作“代码审查”或是“代码评审”,这是一个流程,当开发人员写好代码后,需要让别人来review一下他的代码,这是一种有效发现BUG的方法.由此,我们可以审查代码的风格.逻 ...

  6. code review作业

    下面是对结对编程队友12061166 宋天舒的code review 五个优点: 1.代码的风格优秀,注释不多,但是必要的注释还是有的,比如: // 三种模式 // mode1仅统计单个单词 // m ...

  7. 15个最佳的代码评审(Code Review)工具

    代码评审可以被看作是计算机源代码的测试,它的目的是查找和修复引入到开发阶段的应用程序的错误,提高软件的整体素质和开发者的技能.代码审查程序以各种形式,如结对编程,代码抽查等.在这个列表中,我们编制了1 ...

  8. Code Review 五问五答

    Code Review 是什么? Code Review即代码审查,程序猿相互审核对方的代码. Code Review能获得什么好处? 提高代码可维护性 你写的代码不再只有编译器看了,你得写出审核人能 ...

  9. 大家是怎么做Code Review的?

    先说说我们公司现在的做法,一个团队被人为地分为两个阵营:Senior Developers和Junior Developers,比例差不多是1:1,Senior Developers就担负着对Juni ...

随机推荐

  1. win10安装3DSMAX失败,怎么强力卸载删除注册表并重新安装

    一些搞设计的朋友在win10系统下安装3DSMAX失败或提示已安装,也有时候想重新安装3DSMAX的时候会出现本电脑windows系统已安装3DSMAX,你要是不留意直接安装3DSMAX,只会安装3D ...

  2. 关于安装python第三方库

    安装python库的两种方式: 一)在线安装: 1)pip install 模块名 2)使用国内源安装:pip install 国内源地址 模块名 3)pycharm中setting-interpre ...

  3. iOS中如何实现准确的倒计时程序 · 九十里

    iOS中倒计时程序,考虑线程暂停场景. iOS App进入后台时,GCD线程也会跟着暂停.当程序进入前台后,GCD线程恢复.因而倒计时程序需要考虑这一点,通过加入时间的比对来实现. + (void)c ...

  4. Spring Security基本原理

    近期研究了Spring Security,现进行记录. 首先先进行一个最简单的demo.默认情况下,在Spring Boot里,如果在classpath下面有Spring Security相关的jar ...

  5. mysql长连接与短连接

    什么是长连接? 其实长连接是相对于通常的短连接而说的,也就是长时间保持客户端与服务端的连接状态. 通常的短连接操作步骤是: 连接->数据传输->关闭连接: 而长连接通常就是: 连接-> ...

  6. Snap们崛起告诉我们:这个世界太需要悄悄话

    ​ 北京时间3月3日凌晨,"阅后即焚"应用Snapchat母公司Snap在纽约证券交易所上市.开盘价24美元,比其初定的17美元IPO价格高出近41.2%,按照24美元的股价计算, ...

  7. 基于FPGA的RGB图像转灰度图像算法实现

    一.前言 最近学习牟新刚编著<基于FPGA的数字图像处理原理及应用>的第六章直方图操作,由于需要将捕获的图像转换为灰度图像,因此在之前代码的基础上加入了RGB图像转灰度图像的算法实现. 2 ...

  8. phpstudy渗透到服务器

    0x00 目标站点www.test.ichunqiu 0x01 尝试登陆系统 -尝试弱密码登陆 结果:forbidden!!! -尝试万能账号密码登陆 1‘ or 1=1--+ 和 1‘ or 1=1 ...

  9. 放弃了程序员互联网高薪,跑去事业单位做IT的尴尬

    “你是程序员对吧?”“是啊,怎么了?”“那你帮我修一下电脑吧.”我原来也是一个重点大学毕业,基本上事业里面搞IT就干这些事情,要是以前,我肯定会想,我是程序员和修电脑有啥关系. 但是自从进了事业单位, ...

  10. [Python之路] object类中的特殊方法

    一.object类的源码 python版本:3.8 class object: """ The most base type """ # d ...