How to improve your Pull Request reviews

As a software engineer, it’s important to not only write high-quality code, but also to receive and give constructive feedback on that code.


One way to do this is through PR reviews, where team members review each other’s code changes before they are merged into the main codebase.

Great reviews contribute to your own technical learning and development, help to speed up the release process, and help our your colleagues.

But how can you make sure that your PR reviews are effective, efficient and productive?

Here are a few tips to improve your PR review process:

Spend time reading and understanding the code

Start by reading the code changes, rather than just skimming through them. This will help you get a better understanding of the changes being made and whether they are necessary or not.

Don’t just look for errors

As an engineer who’s earlier on in their career, you may be more accustomed to having errors or overlooked issues pointed out, which might not happen as frequently in a senior’s code (although they definitely can still happen!)

Look for ways to improve the code, rather than just pointing out mistakes. Suggesting alternative approaches or adding comments about best practices can help the original author improve their code.

Ask questions

Your value as a junior doesn’t stop there!

If there are parts of the code you don’t understand, don’t be afraid to ask! It can be intimidating sometimes to ask in a public way on the PR itself, reach out to the author and ask for an explanation.

You will either be learning something new, and getting a deeper understanding of what it is they’ve built, and how.

You might also be highlighting an opportunity for the author to provide a clearer explanation within their code. Chances are that if it’s unclear for you, it might also be unclear for someone else who comes to maintain the code once it’s live in production.

Be specific to what and where you’re talking about

Use line comments to provide specific feedback on individual lines of code. This is more helpful than just writing a general comment about the code as a whole.

Test!

Don’t forget to test the code changes. This can help identify any issues that may not have been caught in the review process.

Pull down the branch and run it locally, is it behaving as you expect it?

Take a look at the tests within the PR itself, can you see a scenario that hasn’t been covered?

Is there something happening in the tests which you don’t think is made clear enough in the code?

Be Kind

Be respectful and considerate in your feedback. Remember that the person who wrote the code is invested in its success.

Review often

Schedule in some time as part of your work day to ensure you have a regular routine and habit of reviewing PRs.

I like to start my day with some reviews, have a slot after my lunch break, and again at the end of my work day.


By following these tips, you can make your PR reviews more productive and helpful for both you and your teammates!

Have any others that have worked well for you in improving your PR reviews?