Writing Constructive PR Comments
4 exercises — write review comments that explain the issue, suggest a fix, and maintain a positive team dynamic.
0 / 4 completed
The anatomy of a great PR comment
- What: Describe the issue specifically — reference the code, not the person.
- Why: Explain the consequence or risk — "this will fail when…", "this makes the code harder to…"
- How: Suggest a fix or direction — "one approach would be…", "consider…"
- Tone: Questions invite dialogue. Statements sound like orders. When uncertain, use "Curious whether…"
1 / 4
A junior developer wrote this code review comment: "This is wrong. Use a proper design pattern."
Which rewrite is the most professional and constructive?
Which rewrite is the most professional and constructive?
Option B is the gold standard for constructive code review. It: (1) opens with a question ("Would it make sense…") to invite dialogue rather than demand compliance; (2) names the specific pattern (Strategy); (3) explains the concrete benefit (easier to add variants without modifying).
Key principle: code review comments should explain the why, not just the what. The reader should understand what problem we're solving with the suggested change. Option A is still accusatory. Options C and D are vague — they don't help the author understand what to do or why.
Key principle: code review comments should explain the why, not just the what. The reader should understand what problem we're solving with the suggested change. Option A is still accusatory. Options C and D are vague — they don't help the author understand what to do or why.