What is a code review?
A code review is when someone other than a code’s author manually views and checks the source code. This can be performed by multiple people — or be performed multiple times by the same person — for a more thorough analysis. Parts of this process can also be automated.
Reviewers look at several factors when studying the code including design, style, functionality, complexity, naming, and testing. These reviews may be conducted in-person or asynchronously.
What is the purpose of a code review?
The most obvious benefit is making sure bad code doesn’t make it into production. But there are actually a lot of other benefits, such as knowledge sharing, improving security, and building a sense of teamwork and collaboration. It also helps aid organizations in achieving greater standardization.
Ensuring quality code (You miss more than you think)
By the time you’ve finished programming, you’ve been staring at the same lines of code forever: let’s face it, you’re probably sick of it, and never want to see it again. At this point, it’s hard to be objective, and the mistakes in your own code are missed as your eyes sweep over them, only seeing your intent and not what’s actually there.
That’s when a pair of fresh eyes really helps. It gives you the peace of mind that someone else will help spot any bugs or other lapses in the source code, while you go make a much needed coffee (or tea). Also, instead of having to patch bugs after the code has been released, bugs can be addressed early on in the software development lifecycle.
Knowledge sharing and teamwork (Also underrated)
While it may be tempting to never want to show anyone your code out of a sense of embarrassment, a code review helps both the reviewer and the reviewee learn.
The person who reviews the code gets to study the source code and style.
The code’s authors can learn from the feedback shared and have the chance to put it into practice immediately.
Both parties benefit from improved communication and understanding on what is going on, breaking down silos.
Through this process, code authors and reviewers can brainstorm ideas, discuss objectives, and develop workflows.
0