The Human Side of Code Reviews

The Human Side of Code Reviews.

Brandon Fish

Code Reviews are one of the most effective practices for keeping code quality high. They help catch bugs early, keep best practices for code style/quality, and share knowledge with co-workers.

Since code reviews involve multiple people being critical of someone’s work, negative emotions often come into play. The following are some suggestions on how to handle the emotions of a code review and effectively communicate with code reviewers.

Expect changes going in Go into a code review with the expectation that changes will be needed to be made. For this reason, it’s best to get code reviewed early on to leave plenty of time for changes. Consider using alternative code review methods like screensharing if it helps you get feedback earlier.

Be your own first code reviewer Before you even make a commit, review all your code changes using git diff or your favorite compare tool. Usually, you can anticipate suggestions people will make and correct them early.

Give reviewers context to your changes Give a good description of the changes and link to the relevant task in the issue tracker. Add enough comments to clarify gray areas in the code. Some code reviewers may be starting the code review with very little background in the area. Making comments inline in the code review can also help clarify.

Deal with code review comments head on Code review comments can provoke negative feelings since they are critical of your work. Don’t take comments personally. Most developers just want help improve the quality of the code.

Handle comments immediately, defer and document suggestions as a last resort If you’re already under pressure to ship code, added code review comments might cause you stress. I find it best to deal with comments immediately to relieve any stress they might cause. Don’t defer fixing any code review comments that can be resolved immediately. If you must defer any code review suggestions, document them in code comments or your issue tracker for follow up.

Acknowledge every comment before closing a review Replying to a comment communicates to reviewers that you have received and resolved the comment by discussing, deferring, or handling the feedback. This shows reviewers you appreciate their comment and encourages them to participate in the future.

Reviewers, give reviewees context to your comments As a code reviewer, it’s useful to mention if the comment is out of scope of the changes being reviewed or could be handled later on. This will help relieve some pressure from the reviewee to complete other code review suggestions.

At the end of the day, remember that code reviews are a team process about making better quality software.

Share this Post

Related Blog Posts

Unknown

Simplifying Distributed Systems Using Apache Kafka

October 28th, 2016

Simplifying Distributed Systems Using Apache Kafka

Object Partners
Unknown

Rest Services with Node, Mongo, & Express

September 30th, 2016

Demonstrating how easy it can be to build our RESTful webservices with Node, I will live code a full CRUD (Create, Read, Update, and Delete) REST service with NodeJS. We will utilize MongoDB as our presistent backend, Mongoose as our ODM (Object…

Object Partners
Unknown

Automating your garage door with MIMOlite

September 20th, 2016

A brief overview and guide of setting up a MimoLite module to monitor and control a garage door.

Igor Shults

About the author

Brandon Fish

Sr. Consultant

Brandon has over 6 years of software development experience with Spring and related JEE technologies including the last year plus working on a large scale enterprise Grails application. He has successfully delivered client projects using a variety of technologies and filling many project roles including lead software developer, requirements gatherer, domain expert, systems administrator, offshore team manager, and Scrum master. He is passionate and up to date with best software development practices in order to deliver projects efficiently, meeting client expectations and with a high quality.