Leadership

The Art of Code Reviews: Building a Culture of Engineering Quality

9 min read By Suraj Kumar Gorai

Code review is the most impactful quality practice in software engineering — yet most teams do it poorly. After reviewing thousands of PRs and establishing review processes for teams of 5 to 20+ developers, here's what separates effective code review from checkbox compliance.

Why Most Code Reviews Fail

Common failure modes I've observed:

  • LGTM syndrome: Reviewers rubber-stamp PRs without meaningful examination. The review process exists but provides no value.
  • Nitpick overload: Reviews that focus on formatting, naming preferences, and stylistic opinions while missing logic errors, security issues, and architectural problems.
  • Gatekeeping: Senior developers who treat review as a power exercise, blocking PRs for subjective preferences rather than objective improvement.
  • Slow turnaround: PRs sitting for days waiting for review. Developers context-switch to other work, and the merge eventually becomes a painful rebase.

The Review Checklist That Matters

I review PRs in priority order:

1. Does it solve the right problem?

Read the ticket/issue first. Understand the requirement. Then check: does the code actually address the requirement? This catches more bugs than any other check — building the wrong thing correctly is still a bug.

2. Are there logic errors?

Walk through the code mentally with edge cases: empty arrays, null values, concurrent requests, error responses, maximum data sizes. The most dangerous bugs are the ones that work with happy-path data.

3. Security concerns?

Is user input validated? Are API calls authenticated? Is sensitive data exposed in logs or client-side state? Are SQL queries parameterized? Security issues are non-negotiable — they block the PR regardless of deadline pressure.

4. Performance implications?

New database queries in a loop? Fetching data on every render? Growing bundle size with a large dependency? Performance issues compound — catching them in review prevents future firefighting.

5. Maintainability

Is the code readable to someone who didn't write it? Are the names descriptive? Is the complexity justified? Would you be comfortable modifying this code at 2am during an incident?

How to Write Effective Review Comments

  • Be specific: Not "this is confusing" but "the variable name d doesn't communicate that this is a date range object — consider dateRange."
  • Explain the why: Not "use a Map here" but "a Map gives O(1) lookups instead of O(n) array.find() — with 1000+ items, this prevents noticeable lag on each render."
  • Distinguish severity: Use prefixes like [nit] for optional suggestions, [question] for clarification requests, and [blocker] for must-fix issues. This helps authors prioritize.
  • Suggest solutions: Don't just point out problems — offer alternatives. "Consider extracting this into a custom hook" with a code suggestion is more helpful than "this component is too complex."
  • Praise good work: Call out clever solutions, clean refactors, and thorough test coverage. Positive feedback reinforces good practices and makes the review process less adversarial.

Speed Up Reviews Without Losing Quality

  • Small PRs: The #1 factor in review speed. A 50-line PR gets reviewed in 10 minutes. A 500-line PR gets "I'll review it tomorrow" (and tomorrow never comes). Enforce a 300-line soft limit.
  • Automation first: Formatting, linting, type checking, and test execution should be automated in CI. Humans should never comment on things machines can check.
  • Review SLA: Our team rule: all PRs reviewed within 4 business hours. This is a team commitment, not a suggestion. We track review turnaround time in retros.
  • Stacked PRs: For large features, create a chain of small PRs that build on each other. Each PR is reviewable on its own, and the feature assembles incrementally.

Building the Culture

Effective code review is a team culture, not a process document. It starts with:

  • Senior engineers modeling thoughtful, kind, and thorough reviews
  • Treating review as a shared team responsibility, not a burden
  • Celebrating great review comments as much as great code
  • Making review time visible in sprint planning — it's real work that deserves real time

Want to level up your team's code review culture? Let's discuss practical changes that make a real difference.