Pros and Cons of Code Reviews: Everything to know about CODE REVIEW as a Beginner — Part 03

Priyanthini Sivasubramaniyam
7 min readAug 9, 2023

--

Hey there!

In this article I am going to discuss the positive and negative sides of “Code Reviews” in the software development process.

Photo by Desola Lanre-Ologun on Unsplash

I have already written a detailed article on what a code review is, which is followed by the next article explaining the automated code reviews. In the introductory article I have explained the concept of code review in detail along with the different approaches that we can use. But I have only pointed out the pros and cons of code reviews without explanations there. So I just thought to give you some more insight into those pros and cons of the Code Reviews by explaining them in detail.

In simple terms, Code Review acts as a quality assurance tool which is focused on discovering the errors in the software product which will then be fixed before releasing the product to the end users. Reviewers can be taken from any team in an organization (not necessarily the development team) as long as they are experts in the domain in which the code base is developed. With that simple introduction let’s dive directly into the comparison of positives and negatives of code reviews.

If you want to understand more about the code review process before proceeding with this article, you can click on this link and check my introductory article on the concept.

The Pros / Positive Aspects of Code Reviews

  • High quality code/ Better code quality: Code reviews help us in identifying and fixing the issues and errors with our code at the early stage of the software development process. This can lead to fewer issues in the final software product and improve the overall quality of the code. Simple mistakes, logical errors and even the architectural issues are identified and solved at the beginning which results in a higher quality code.
  • Improved code readability: In code reviews, the coding approach and styling are too assessed. In that case, with the suggestions of the reviewers our codes become more and more structured with the proper standards and styling. This makes our code more readable and any other developer can understand and work with the code easily.
  • Knowledge sharing within the organization: Code reviews provide reviewers as well as developers a great chance to learn new techniques and solutions. This process helps developers, especially the junior developers to learn more from their senior team members or experts. People can share their ideas, skills and knowledge in a very effective manner. So we can say that the code reviews enable knowledge sharing across the organization.
  • Early detection of errors: Code reviews pave way to find and fix errors at the early stage of software development rather than doing it after the release. Finding errors early in the process makes it easier and less expensive to correct them. And you can avoid those errors from being amplified once you proceed further with the development process. Early detection of errors helps to avoid the hustles at the time of release.
  • Saves time and money: These code reviews also help in saving time and money by reducing the amount of rework or modification that will be required later in the project.
  • Improved collaboration among the co-workers: Code reviews allow people from different teams to work together. This creates good collaboration and communication among the employees of the organization. Colleagues share their ideas, learn from each other and enhance their knowledge too.

The Cons / Negative Aspects of Code Reviews

  • A time consuming process: Code review is a time consuming process as the reviewers have to go through the whole code base developed by their peers line by line to review and provide comments and suggestions. Also when the developer provides a larger code base to review (providing the code base after the complete software product development is finished), then it is going to take much longer time for the reviewer to check the whole code. In this case, there is a possibility for the reviewer to get tired of this code reviewing and to try to finish the review as soon as possible. When the reviewer speeds up the reviewing process just to finish it somehow, then the feedback of that code review process will be of lower quality.

We can try to reduce this time consumption by providing regular updates or incremental code changes to the reviewers rather than providing the whole project at the end of the development. Then the reviewers will have enough time to review each small change the developer makes without any hustle and they can give their full attention to the review process since the workload seems less for them when compared to reviewing the whole code base.

  • Delay in releases: The longer review time can delay the release process, since reviewers have to collaborate with authors to discuss problems. Once the reviewer gives suggestions, then the developers have to refactor their codes if there are any changes needed and submit the code again for reviewing until it gets approved by the reviewer. The release of the product will be delayed as long as this reviewing process gets delayed. Another thing is that the reviewer may not complete a review as fast as the author would like because of his/her own workload (the reviewer is not just solely assigned for this work, he/she is a part of another team in the organization). So it really becomes an issue.

One way to overcome this issue is using the code review tools that include automated testing to find errors. Then a portion of the reviewer’s time can be saved so that they can focus on the larger software engineering problems rather than checking the smaller errors. And we can also have a pool of reviewers assigned for the code reviewing task rather than assigning one reviewer, which can reduce their workload and speedup the code review process.

  • Conflict of interest (miscommunication): Different developers may have different preferences especially when it comes to coding style, commenting methods and coding approaches. This can lead to conflicts during code reviews.

As a reviewer when you are giving a comment or feedback make sure that you are giving that comment as a suggestion and in a most convincing way. A reviewer is there to review the code not to assess or judge the skills of the developers. And as a developer when you are getting feedback from the reviewer, you always have the right to reject it, but with proper evidence and explanations. When you are disagreeing with a feedback, make sure to explain your opinion in a polite way with proper evidence or supporting documents. Better to follow up a professional way of communicating the opinions.

  • Deviation of focus from other tasks: Developers often have a huge workload, and a code review can deviate their focus from other tasks that they’ve been assigned. In some instances, reviewers might be forced to decide whether to complete their task first or pause their work in order to do a code review first. They will feel pressure in giving priority. But in both cases, the work is going to be delayed somewhere across the organization. When they prioritize their own work above the code review, then the reviewing process will be delayed and ultimately the release of that particular product will be delayed. In the other case if they prioritize the code review process, then their own works will be delayed.

To overcome this issue it is always better to have a list of domain experts/reviewers in the company and assign more than one reviewer to one inspection so that a single developer will not be burdened with all the code review works.

  • Limited coverage: Unexpected errors cannot be identified and fixed with this code review process. Keep in mind that a code review can not identify all the errors available in a code base and it may not cover all the aspects of the code. Some issues can only be identified after releasing the software product to the customers, and code review cannot help in those situations.
  • Another challenge with the code review process is that it is always difficult and expensive to set up a separate review or inspection team in small companies where they have limited budget and other resources.

Those are the positive and negative aspects of a code review process that I wanted to share with you all.

You can learn the basics of code reviews by clicking the link below:

If you’re interested more, go through my article on automated code reviews by clicking the link below:

If you find this article useful and worth to read provide your claps, comments and share this article with anyone who might need it.

You can also buy me a coffee as a reward to encourage my work which will truly motivate me to bring up more and more articles and posts like this.

Thank you and catch you all with another interesting topic soon !!!!

--

--

Priyanthini Sivasubramaniyam

Assistant Lecturer, University of Colombo School of Computing. Writing on Software Engineering and Marketing related topics. Sometimes on self improvement :-D