Reviewing code is a skill
Code review is a skill that developers of all levels can hone, not just junior programmers. Recently, there has been much discussion in developer communities about the purpose and effectiveness of code review, especially in the last two years. Some claim that code review is not for certain things, but rather for others. To better understand what developers expect from code reviews, researchers analyzed interview data from Google developers and identified four key themes: education, maintaining norms, gatekeeping, and accident prevention.
Education involves learning or teaching from a code review, while norms refer to organizational preferences for discretionary choices such as formatting or API usage patterns. Gatekeeping concerns establishing and maintaining boundaries around source code, design choices, or other artifacts. Accidents refer to the introduction of bugs, defects, or other quality-related issues.
Modern code review studies have shown that while finding defects remains the primary motivation for review, reviews also provide additional benefits like knowledge transfer, increased team awareness, and creation of alternative solutions. Developers use various mechanisms to understand code better, many of which are not supported by current tools.
In this article, the author aims to establish that reviewing code is a skill. To illustrate this, they provide three examples of bugs they found while reviewing code. These bugs are relatively unambiguous to demonstrate the point. The author then shares their background related to code review and argues for the core thesis that code review is a skill.
The author mentions that in two out of the three examples, the person who wrote the PR had experience with the surrounding code. They also note that large language model (LLM) reviews with advanced coding models were not able to catch the issues the author found. This raises questions about the effectiveness of relying solely on automated tools for code review.
The author concludes by addressing some common memes about code review and comparing them to the thesis in mind. They encourage readers to think about both sides of the arguments presented in the examples.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.