The context buddy system

Have you ever been asked to code review a pull request only to find thousands of lines of code had been changed, and you have no idea what the code is doing and why those changes were made?

Have you ever sent your pull request for review thinking that you were finally done with this task, only to read the feedback and realize you will need to rewrite large chunks of your solution?

🙀🙀🙀🙀🙀🙀

Have you ever spent a day waiting for your code to be reviewed and wasting time switching between tasks?

The traditional way of doing code review can be painful for both the person who writes the code and the reviewer. If all engineers were pair programming on every task there would be no need for the pull request inspection type of code review. Unfortunately, for reasons good and bad, that’s not always possible.

My team at Greenhouse came up with a compromise that we call the Context Buddy.

How it works

The idea is that for every task in progress, there is an assignee who is responsible for writing the code and a context buddy who will eventually perform the code review. The context buddy is involved in every phase of development starting with the planning session. They are included in meetings, part of the decision making and are aware of the progress of the work. The buddy is pulled in for pairing sessions when needed, especially during critical phases of development.

The benefits of the context buddy system

Knowledge is shared within the team

A typical code reviewer only learns about how the solution was implemented. A context buddy understands the context around which a piece of functionality was built and can explain the decisions and trade-offs that were made during development.

Tasks are completed faster

When a team member goes on vacation or is out sick, the context buddy can easily take over the task and carry it to the finish line. This system also reduces the time spent reviewing the code since the reviewer is already familiar with the solution. On top of that, if the team shares a common backlog, code reviews can be prioritized over other tasks and get completed faster.

Better code and easier code reviews

With the context buddy involved in architectural decisions, major design flaws should have been addressed by the time the code is ready to be reviewed. This makes it less likely for the person who wrote the code to have to rewrite large parts of the solution. It also allows the review to be focused on other aspects such as security vulnerabilities, performance, and readability.

Shared ownership

Since the context buddy participated in the design of the solution and helped make the crucial decisions along the way, they develop a stronger sense of ownership towards the code. They have a feeling of accomplishment when the new feature is released and are more comfortable maintaining it.

Do you want to be my buddy?

The beauty of the context buddy system is that it is extremely easy to implement and it doesn’t require a strict framework. All you need to do is find a buddy when you start a new task and make sure they are following along. Include them in critical decisions and get their buy-in for your solution. In addition to producing better quality code, it will make both your lives easier.

Be my next buddy! Apply to Greenhouse!