I've shared previously about how to avoid being defensive in a code review and even how to start to love having your code reviewed.
Today's tip shifts the perspective from the person receiving the review to the person giving the review.
When you are reviewing code, it's easy to get caught up in the mistakes and things that could be improved. There's no doubt that catching problems before they reach production is a major benefit of code review, but it shouldn't be your only focus.
Instead, approach the review with an open mindset, realizing you may find something in the review that you can learn from.
For example, did the developer leverage a newer feature in Laravel that you didn't know about?
Take note of that, and tuck it away for future use, but go a step further and add a positive comment to the review like "I didn't know about this, nice!"
Be careful not to make this a calculated technique where you try to say enough nice things to make them less mad about the mistakes you point out. It should be motivated by sincerity.
I know I've received little positive notes like this, and really appreciated them.
Here to help,
Joel
P.S. Are you a solo developer and would like some help reviewing your code to level up your skills? Send me a note and let's see how we can help.