Code reviews are the heartbeat of a healthy engineering team. They are our primary mechanism for ensuring quality, sharing knowledge, and maintaining consistency. However, if we approach them solely as a bug-hunting expedition or a style enforcement mechanism, we miss the point—and we risk frustrating our colleagues.
Let’s explore how we can elevate the code review process from a chore into a powerful tool for team growth and product stability.
- The "Why" Behind the "What" Before you even look at a single line of code, you must understand the context. A PR without a description is like a map without a legend.
As an Author:
If you want good reviews, set the stage. Your PR description should answer three questions:
- What does this change do? (Summary)
- Why are we doing it? (Link to the ticket/issue)
- How should we test it? (Screenshots, terminal outputs, or test steps)
As a Reviewer:
Start by reading the description, not the code. If the "Why" is missing, ask for it. You cannot judge the execution if you don't understand the goal.
- The Golden Rule: Review the Code, Not the Person This is the oldest rule in the book, yet it is the hardest to master.
It’s easy to read a line of code and think, "This is messy."
It’s harder, but more productive, to think, "This block is hard to follow."
The difference is subtle but crucial. The first statement (This is messy) attacks the author's identity. The second (This is hard to follow) describes a neutral observation about the code itself.
How to phrase feedback:
- ❌ Bad: "You forgot to handle the null case here."
✅ Good: "We should handle the null case here to prevent a potential runtime error."
❌ Bad: "This variable name doesn't make sense."
✅ Good: "This variable name is a bit ambiguous. Could we rename it to something more specific like
activeSubscription?"
- Automate the Nitpicks This is the single biggest productivity hack for code reviews.
If you are commenting on missing semicolons, incorrect indentation, or a poorly named variable that could be caught by a linter, you are wasting everyone's time.
Modern development environments are powerful. Use tools like ESLint, Prettier, RuboCop, or GitHub Actions to enforce code style automatically.
Why?
By automating the "boring" stuff, you free up your brainpower to focus on the interesting stuff: architectural soundness, security vulnerabilities, performance bottlenecks, and user experience.
If your CI pipeline passes, the code is formatted correctly. Don't mention it in the review.
- The Balancing Act: Nit vs. Blocking Not all comments are created equal. As a reviewer, you must be explicit about the weight of your feedback.
- Blocking (Request Changes): This is a critical issue. The code is wrong. It will break production, introduce a security hole, or completely miss the business requirement. The PR cannot be merged without addressing this.
- Ask (Question): "I’m curious about this approach. Was there a reason you chose a
forloop here instead ofmap?" This invites discussion and learning. - Nit (Nitpick): "This is a really minor thing, but..." or "Consider renaming this for clarity." Nits should never block a merge. If the author has other things to do, they should be allowed to ignore a nit and move on.
- Praise in Public Code review comments are a permanent record. If you see something brilliant—a clever solution to a complex problem, a really well-written test, a great use of a design pattern—say so.
Positive reinforcement is not just "being nice." It sets a standard. When you praise a specific technique, you are telling the rest of the team, "This is the kind of quality we value here."
- "Wow, I didn't know you could use the new CSS
:has()selector like that. TIL!" - "This utility function is incredibly clean and reusable. Great work."
- Timeliness > Perfection We’ve all been guilty of letting a PR sit for two days while we finish our "important" work. Meanwhile, the author is blocked, context is lost, and merge conflicts start to pile up.
Aim for async-first collaboration.
- Small PRs are better. A 10-line change is easy to review. A 2,000-line change is intimidating and likely to be skimmed or ignored.
- Respond within 24 hours. Even if it's just, "I got this, will review by EOD," it unblocks the author mentally.
The Final Verdict
A great code review shouldn't just end with a merged PR. It should end with both the author and the reviewer feeling like they learned something.
The goal isn't to have the cleanest code in the history of software. The goal is to ship value to users reliably while maintaining a happy, collaborative team.
Let’s be the kind of reviewers who unblock, teach, and collaborate—not just critique.
What’s your biggest pet peeve in code reviews? Or, what’s the best piece of feedback you’ve ever received? Let’s discuss in the comments!
Top comments (8)
Thanks for taking the time to write this up. It's obvious you put a lot of effort into the examples, and they really helped illustrate your point.
hi.. nice to meet u. thx for your kindness
Welcome to the community! I'm glad this was one of your first reads. There's a ton of great content here to explore.
This was a really clear explanation. I've struggled with this concept before, but the way you broke it down step by step made it finally click for me.
thx very much
Oh, I haven't tried that library before. I'll have to check it out. Thanks for the recommendation.
You're right, I should have included a section on that. I'll keep it in mind for the next time I write about this topic.
I appreciate you catching that typo! I'll go fix it now. Thanks for looking out.