The Art of Effective Code Review: Beyond 'LGTM'

Those four letters on a Pull Request: 'LGTM'. A harmless approval, or a symptom of a deeper cultural problem? In this guide, we explain how to end superficial comments, ego wars, and wasted time, and turn code review into a tool for mentorship and collective learning.
Introduction: The Most Dangerous Four Letters: L-G-T-M
You've worked for hours. You solved a complex problem, wrote your tests, and hit that satisfying 'Commit & Push' button. Your Pull Request (PR) is ready. You're waiting for valuable feedback from your teammates. And a few hours later, the notification arrives: "LGTM." As in, "Looks Good To Me."
At first glance, this might seem like an approval. But in reality, LGTM is often a sign of a deeper problem within software teams, a cultural erosion. A superficial pass-through due to time pressure, conflict avoidance, or indifference is like a termite slowly eating away at the quality of your project. A code review is not just bug hunting; it is a sacred ritual where a team enhances its collective knowledge, maintains its standards, and shares ownership of the code. This guide will show you how to go beyond LGTM and turn this ritual into an art form.
Part 1: Why Do Our Comments Fall into the 'LGTM' Trap? (The Psychological Dimension)
No one wants to do a bad job. So why do so many smart developers resort to superficial comments in code reviews? The reasons are often not about technology, but about human psychology:
- Time Pressure: "I don't have time to review this, I need to finish my own work." The relentless pace of modern software development makes us see in-depth review as a luxury.
- Social Hesitation (Fear of Conflict): "Will my friend be offended if I make a negative comment on their code?" or conversely, "If I find a 'mistake' in a senior developer's code, will they think I'm ignorant?" No one wants to be the "annoying nitpicker" on the team.
- Uncertainty and Lack of Knowledge: "I don't fully understand what this code does or the system it touches. It's best if I stay quiet and don't get myself into trouble." A feeling of inadequacy leads to silence.
- Role Ambiguity: What is the reviewer's job? A police officer finding faults, or a mentor showing the way? The ambiguity of this role pushes people to the safest harbor: "approval."
Part 2: The Reviewer's Responsibilities: Be a Mentor, Not a Detective
An effective review is inquisitive, not accusatory. The goal is not to point fingers, but to arrive at a better solution together.
Change Your Communication Style
- Ask Questions Instead of Giving Commands: Instead of saying "Change this," ask, "I was curious about the reasoning behind making this change this way. What would be the pros/cons of an alternative approach like this?" This starts a dialogue.
- Explain Subjective Comments: "This code is bad" is an opinion. "I feel the name of this function doesn't fully reflect what it does. This might be confusing for future developers reading the code." is constructive feedback.
- Don't Hold Back on Praise: Reviewing isn't just about finding faults. Saying, "You've solved this complex problem very elegantly, well done," both boosts motivation and makes criticism easier to accept.
Example Comments: Before and After
Bad Comment: "This function is too long."
Good Comment: "This function seems to be taking on several different responsibilities (fetching data, filtering, formatting). To improve readability and make it easier to reuse, could we consider splitting it into two or three smaller functions?"
Bad Comment: "Don't use a global variable here."
Good Comment: "Global variables can sometimes lead to unexpected side effects. Passing this state as a prop to the component or using a state management tool might be a more predictable solution. What do you think?"
Part 3: The Author's Responsibilities: From Defense to Collaboration
The review process is not a one-way street. As the code owner, you have responsibilities too.
- The Art of Preparing a PR: Do a final review of your own code before submitting it. Clean up unnecessary code and logs.
- Write Descriptive PR Descriptions: A blank PR description is a sign of disrespect to the reviewer. Use a template:
- Problem: What problem does this PR solve? (Include a ticket link)
- Solution: What approach was taken to solve it? What architectural decisions were made?
- How to Test: Make the reviewer's job easier. Provide step-by-step testing scenarios.
- Don't Take Feedback Personally: The comments are about your code, not your personality. The goal is to collectively produce a better product.
- Clarify Comments You Don't Understand: Don't hesitate to say, "I didn't fully understand this comment, could you explain with an example?"
Part 4: Concrete Steps to Improve the Culture as a Team
Individual efforts are important, but lasting change comes as a team.
- Use PR Templates: Make the "Problem, Solution, How to Test" structure mandatory for the whole team.
- The Principle of Small PRs: No one wants to review a massive 500-line PR in detail. Logically break down your changes into small, digestible pieces. A PR should ideally do one thing.
- Set Aside Time and Add It to Your Calendar: Code review is not a "do it in your spare time" task. Dedicate a specific time slot each day (e.g., 30 minutes) to this work.
- Balance Asynchronous and Synchronous Communication: Not every comment has to be written. Instead of spending minutes writing back and forth on a very complex topic, saying "Can we quickly share screens for 5 minutes?" can prevent a misunderstanding that could last for hours.
Conclusion: Building Culture Beyond Code
An effective code review process results in fewer bugs, better performance, and cleaner code. But that's not the real prize. The real prize is a team culture where knowledge is spread, no one is blindly attached to "their" code, egos are left at the door, and everyone learns from each other. The transition from LGTM to in-depth, empathetic comments is one of the most important signs of a company's engineering maturity. You can be part of this change by starting to apply these principles in your next PR, whether as the reviewer or the author.
