Blog

Our Code Review Guidelines

Placeholder Avatar
Daniel Draper
August 16, 2017

Here at reinteractive, we care deeply about the quality of our code. We have many processes in place to ensure that the code we produce for our clients is of the highest quality, one of which is a mandatory code review. Before any feature makes it into staging, it must be reviewed by at least one, and preferably two, other developers.

What is a Code Review?

To quote Wikipedia, a code review is a systematic examination of source code. It is intended to find mistakes overlooked in the initial development phase, improving the overall quality of software.

What is a Code Review to Me Personally?

A code review is an exciting opportunity to learn, both for the requestor and for the reviewer. The exchange involved in getting a pull request accepted allows all parties to level up their skills. It is an opportunity to discuss problems, especially since you may find yourself with a similar problem in another project.

The hunt for a good solution fosters the feeling of teamwork. We are all in this together, and we all share the common goal of releasing high-quality software.

Finally, having all code reviewed by many different developers ensures consistency and improves the overall quality of the code.

Why Should I Care?

Because our valuable final product is bug-free features developed, delivered and accepted by the client, helping them achieve their goals within their budget.

Our Code Review Guidelines

PRIORITISE:

  • Make time to review. Taking the time to give a thorough code review benefits the requestor, the reviewer, and the client.

COMMON COURTESY:

  • Be nice.

  • Don’t be personal.

  • Keep in mind that many programming decisions are opinions only.

  • If your opinion on how something should be done differs from that of the requestor, offer suggestions and discuss tradeoffs.

  • Avoid ownership. Remember we are a team.

  • Always review as if the requestor is a violent psychopath who knows where you know (adapted from John Woods famous quote)

WHAT TO FOCUS ON:

  • Discuss architecture

  • Talk about patterns

  • Use robots to review code style, so that PRs aren’t just formatting-related comments

KEEP THESE KEY POINTS IN MIND:

  • Remember that sometimes you need to do something right now, not necessary right. For example, urgent security fixes.
  • Plan for the future but build for today.

CONVENTIONS:

  • Use @mentions to talk to someone.
  • When you’re satisfied, approve the PR with a “LGTM üëç “.