?? Code Review: The Reviewer: Mindset Matters
Richard Donovan
Software Engineering Manager @ OVO | Author of The Modern Software Developer newsletter | Mental Health First Aider
Introduction
Code reviews can be critical for ensuring code quality.
By scrutinising each other's code, we keep each other accountable.
We can:
?? Enhance code readability
?? Uncover potential bugs
?? Share our knowledge
Ironically, the code might not be the most important aspect of a code review.
In this article, we explore the role of mindset during code reviews from the reviewer's perspective.
Key Takeaways ??
? Mindset Matters:
> Your mindset directly impacts team dynamics, morale, and the effectiveness of feedback.
> The right mindset promotes respect, trust, and collaboration.
> Your feedback impacts your team’s confidence and wellbeing.
? Effective Code Review Practices:
> Prioritise feedback on code quality, readability, and maintainability.
> Offer specific suggestions rather than vague criticisms.
> Show empathy for the author and sensitivity to time constraints.
? Continuous Improvement:
> You set the tone for a culture of continuous learning.
> Use code reviews for knowledge sharing and skill development.
> Encourage a growth mindset among your team to make the most of feedback.
Why Review Code?
Some teams insist on code reviews… others don’t…
Some benefits of code reviews include:
? Knowledge Sharing
? Code Maintainability
? Improved Code Quality
? Continuous Improvement
? Risk Mitigation (to some extent…)
?? This is a short version
In the full version here:
Why It Matters ??
Your mindset directly impacts the outcome of your code reviews...
?? It impacts how well your message is received.
?? It impacts the level of respect your team has for you.
?? It impacts the morale and confidence level of your team.
?? It impacts the wellbeing and mental health of your team.
?? It impacts how willing your team will be to implement your feedback.
You need to recognise the potential for your team to feel judged and the impact you could have on their confidence.
You also have an opportunity to enhance growth, build trust and improve collaboration in your team.
Approaching code reviews with the right mindset helps build a positive team culture and creates a safe space for people to share their work.
Take Action ??
Code reviews aren’t about marking someone’s work as right or wrong.
Your actions can help someone grow or can destroy their confidence.
Code reviews are about teamwork and getting to the preferred solution for your team and business.
The next time you’re reviewing code, consider these Dos and Don’ts:
Don'ts:
?? Block based on nitpicking:
Avoid blocking code reviews based on trivial issues that don't significantly impact code quality or functionality.
If you nitpick, call it out and flag it as a low priority.
?? Use vague or ambiguous feedback:
The last thing you want is for the code author to read your comments and not know what to do next.
领英推荐
Ensure clear, specific, and actionable comments to help understanding and implementation.
Consider jumping on a call if there are too many comments or the subject is complex.
?? Criticise without providing suggestions:
Avoid pointing out flaws without offering constructive solutions or alternatives.
?? Ignore context or project constraints:
Consider timelines and constraints when providing feedback to ensure practical recommendations.
Suggesting a complete rewrite of a feature is not helpful when the release deadline is a few hours away.
?? Be Rude:
Be mindful of how your comments might be received, and maintain professionalism and respectfulness in all communications.
It’s not ok to be rude just because you feel frustrated.
Dos:
?? Focus on the code:
Phrase comments constructively, focusing on the code rather than the person.
“Don’t do this!“ - Isn’t helpful…
?? Focus on high-impact issues:
Prioritise critical aspects such as security vulnerabilities, performance bottlenecks, and architectural concerns.
?? Offer suggestions:
“This is the wrong approach.“, isn’t super useful.
Explain why and provide a suitable alternative, a link to an article, or an example of where the correct approach has been used.
At the very least, ask probing questions to help the code author solve their own issue.
?? Show empathy:
Be courteous and polite; the developer receiving your comments is a person and has feelings.
You don’t get the best out of them be belittling them.
Put yourself in their shoes.
?? Be sensitive to time:
If a code review is time-sensitive, consider jumping on a call to rattle through it.
Rich’s Recommendations
Check out my recommendations to improve your wellbeing, mindset, leadership or tech skills:
?? Basma Taha - Your Guide to Fast-Track Your Software Engineering Career. Newsletter: An Engineer's Echo
?? Hemant Pandey - Writes about career growth, study abroad and life experiences.
He's a Tech Lead at Meta.
Newsletter: The Hustling Engineer
?? Crushing Digital - David Roberts Get help to stand out in the market, land more interviews and get the job you deserve.
?? Neo Kim ’s weekly newsletter to learn system design:
Newsletter: System Design Newsletter
?? Nick Cosentino ’s weekly newsletter to help you level up as a software engineer!
From a Principal Engineering Manager at Microsoft.
Newsletter: Dev Leader Weekly
?? John Crickett ’s weekly coding challenge to help software engineers level up:
Newsletter: Coding Challenges
Closing
Hopefully, you recognise the critical role of mindset in code reviews.
I hope it’s enough to get you to think about your own approach.
Code reviews are a great opportunity, unfortunately missed by many.
By embracing a growth mindset, teams can create an environment where everyone feels valued, respected, and empowered to contribute their best work.
In my next issue, I’ll take a similar approach to this but focus on the code author rather than the reviewer.
Remember
There's nothing more important than your own wellbeing!
Founder - Xemiron IT Solutions | Web Design, Development, Cyber security & Digital Marketing Solutions for Empowering Business
11 个月I appreciate it
Approaching code reviews with the right mindset is crucial for team dynamics and effectiveness. Let's promote respect, trust, and collaboration!
Senior Data Engineer
11 个月Resonates alot with my article: https://www.junaideffendi.com/p/code-reviews
Senior Software Engineer @Multiverse | Prev: Monzo, Bloomberg, and Amazon.
11 个月Awesome topic, Richard! I genuinely think that code reviews are very important for engineers. If used right it works as a valuable learning and sharing experience resource. Being considerate, yet direct, and clear, goes a long way! ?? Thank you so much for mentioning my newsletter! Really appreciate it ??