6 Little Things That Can Make You Seem Like Less of a Jerk When Reviewing Someone’s Code
Sometimes, we all make the mistake of being a little too critical or nit-picky.
In software development, doing a code review is often seen as a chore or a rubber stamp requirement for quality control. Because of this, it’s easy to rush through and look like a total jerkface while doing it.
But it doesn’t have to be that way! If you come into a code review with an open mind and a willingness to help, you can turn it into a learning opportunity for everyone involved.
We’re all human, and we all make mistakes. Remember that everyone is learning, and give people the benefit of the doubt. Being a helpful and constructive code reviewer is all about striking the right balance, and these tips should help you get there.
Give Constructive Feedback Instead of Unhelpful Corrections
When giving feedback during a code review, it’s important to be constructive. This means pointing out the flaws in someone’s code without being critical or nit-picky. Here are a few tips on how to do that:
Start by highlighting the good things. This will help put the reviewer in a more positive frame of mind and make them more receptive to your feedback.
Be specific. Don’t just say “this code is bad.” Say “these are the problems I see with this code, and here’s how you could fix them.”
Frame your feedback in terms of solutions, not problems. For example, instead of saying “you need to fix this bug,” say “I think this would be a good time to add a unit test for this function.”
Avoid using negative language. Saying things like “you’re doing it wrong” or “this is broken” will only make the reviewer defensive and less likely to listen to your feedback.
Be patient. Code reviews can be frustrating, but it’s important to remember that the person you’re reviewing is probably not a mind reader. They need time to digest your feedback and implement changes.
Ask Questions Instead of Giving Orders
When giving feedback during a code review, try framing your comments as questions instead of orders. This will help the reviewer feel like you’re on their side, and that you’re both working together to improve the code. For example:
Instead of saying “you need to fix this bug,” say “should we fix this bug?”
Instead of saying “this code is wrong,” say “is this the right way to do this?”
Instead of saying “you’re doing it wrong,” say “what was your thinking here?”
Ask for their opinion. For example, say “do you think this change is worth making?” or “would you have done it differently?”
Avoid Nitpicking
One of the best ways to come across as a helpful code reviewer is to focus on the big picture and avoid nitpicking minor code style mistakes. This can be difficult, especially if you’re passionate about coding, but it’s important to remember that minor details can always be fixed later.
Constantly correcting people on missing newlines and spacing issues is not actually helpful, and can make you seem like a jerk. In fact, it’s often more beneficial to focus on the overall structure of the code, and how it works rather than how it looks.
Finally, it’s important to be aware of your own biases and assumptions. Just because you don’t agree with someone’s code doesn’t mean that they’re wrong. Try to maintain an open mind, and be willing to listen to other people’s points of view.
Be Respectful
Another way to come across as less of a jerk is to be respectful and polite. This means taking the time to explain your feedback in a clear and concise manner, and avoiding condescending or rude comments.
Remember, the person you’re reviewing is likely a colleague or peer, and there’s no need to be nasty or insulting. You might need their help someday and you’ll be glad they’re still speaking to you!
We’ve All Been There Before
When you’re reviewing someone’s code, it’s important to remember that you have been in their shoes before. You were once a beginner too, and you probably made plenty of mistakes along the way.
This is why it’s important to be patient and understanding when working with other developers. Wouldnt it be great if we could all have a mentor who treated us like a peer?
Gain the Respect of Your Peers by Being the Conscientious Reviewer
When you’re known as the person who is always willing to help and give constructive feedback, you will gain the respect of your peers. This means being conscientious in your reviews and taking the time to provide thorough and well-thought-out feedback.
By being respectful, your teammates will look up to you, instead of fearing you as the nit-picky, critical reviewer. This will help to create a more positive and constructive environment in which everyone can work together and improve their codebase.
Improve Yourself by Helping Others To Improve
These are just a few tips to help you avoid coming across as a jerk when giving feedback. By following them, you can help make the experience a little less painful for everyone involved.
Try out these tips the next time you do a review. I think you will see an amazing improvement in the way people respond to your feedback. And most importantly, remember to have fun and enjoy the process!
Happy reviewing!