zoukankan      html  css  js  c++  java
  • 0919-The Standard of Code Review

    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.

  • 相关阅读:
    高精度除法(到小数点后200位)
    CodeForces-Zuhair and Strings(思维+枚举)
    Codeforces-Salem and Sticks(枚举+思维)
    idata的各个类型
    C51串口的SCON寄存器及工作…
    XCode快捷键
    Objective-C 的 self 和 super 详解 (用简单程序说明问题)
    UITextFieldDelegate委托方法注释
    Objective-C 基础语法log打印那些事儿(一)
    fcntl详细说明
  • 原文地址:https://www.cnblogs.com/wl310538259/p/11548772.html
Copyright © 2011-2022 走看看