- You are now in reviewer mode. You open a PR. Before clicking “Comment”, take a second.
Pause. Put yourself in the shoes of the person who wrote the code.
1.1. Start by Understanding the “Why”
“I don’t understand what they were trying to do…”
→ Maybe you have not read enough context yet.
- Before reading a single line of code, read the PR description.
What is the goal?
Which ticket is associated with it?
What tests have been performed?
- Be a facilitator:
“Hi! Could you add a short paragraph explaining the goal of this change? It would help me understand the context better. Thanks!”
- A standardized PR template on GitHub or GitLab can make a huge difference. Useful sections include:
- 🎯 Goal
- 🔧 Key changes
- ✅ Tests performed
- ⚠️ Points to watch
Fewer back-and-forth discussions, more clarity.
1.2. Read the Code… as If You Had to Maintain It Tomorrow
Imagine you have to work on this code again in six months, with nobody around to explain it.
Ask yourself these simple questions:
Is it readable?
Does it follow the team’s conventions?
Are there hidden bugs or performance issues?
Is it really necessary? Is it tested?
Concrete example:
You see a nested for loop running over a list of 10,000 elements.
→ Complexity: O(n²).
→ In production, that could become a serious performance issue.
Instead of saying: “This is slow.”
Suggest:
“Could we use a Set here? That could reduce the complexity to O(n) and help avoid a slowdown in production.”
→ You are helping, not humiliating.
1.3. Give Feedback That Builds, Not Feedback That Breaks
Tone matters.
Compare these two messages:
“This is badly named. Redo it.”
✅ “The variable tmp is a little vague. What if we called it userSessionId? That way, everyone immediately knows what it contains.”
The difference? → Constructiveness.
- Here are three useful approaches:
- The gentle suggestion: “Could we extract this logic into a function? That would let us reuse it elsewhere.”
- The open question: “Why did you choose this approach? Was there a specific constraint?”
- The clear distinction:“This point is blocking because of security, but the variable name is only a suggestion.”
- Use labels:
- 🔴 Blocking: security issue, critical bug
- 💡 Suggestion: possible improvement
- ✨ Nitpick: small style detail such as indentation or naming
And when you reference a standard or practice, add a link when useful.
→ It turns feedback into learning.
1.4. Turn the Review into a Conversation, Not a Monologue
Code review is a discussion, not a verdict.
If a change is complex, suggest a pair-programming session.
Or a quick Slack/Teams call.
“I’m not 100% sure I understand your approach. Want to do a quick 10-minute call?”
→ It shows that you want to understand, not impose.
And sometimes… you are the one who learns something new.