Master

Giving feedback people actually respond to

Good code review is a skill you can get genuinely good at, and it's as much about tone as about catching bugs. The best reviewers are remembered for the reviews that made the author think, not the ones that made them defensive. Learning to give and receive that kind of feedback is worth more than any single syntax rule.

What you will see

Reviewing pull request #1 Submitted a review that approves the changes.

About 2 min of reading

Quick check

Before this new lesson, one small question about the lesson you just finished. Recall it, do not look it up.

Try It

I used to review with a verdict, and the author went defensive instead of thinking. Let me read someone else diff, then write the kind of note that explains the why, points to the exact line, and asks a question instead of issuing an order.

1

Start by reviewing your own diff before you even open the pull request. git log --oneline shows the commits, and the diff between them is what you are about to ask someone to read. You will spot the obvious mistakes, a leftover debug line, a test you forgot to update, that a reviewer would call out anyway.

git log --oneline git diff main...feature/login

Before you run it, say out loud what it will print. Then open the answer.

What it prints
abc1234 Add login form feature/login def4567 Add login form @@ -1,1 +1,1 @@ +login form
Reviewing your own diff first is what earns you a quicker, friendlier review. It short-circuits the slow back-and-forth before a stranger looks at the code.
2

The pull request is where the review happens. Open it so the reviewer can read the exact change with a field for what changed and why. The whole back-and-forth lives in one place, tied to the real lines, instead of being lost in chat.

gh pr create --title "Add login form" --body "Builds the login page on its own branch."

Before you run it, say out loud what it will print. Then open the answer.

What it prints
Creating pull request for feature/login into main https://github.com/ada/myapp/pulls/1
A review has no effect until the PR is open. Do not try to review a change that has not been pushed and turned into a pull request yet.
3

Now read the diff as a reviewer. Instead of "this is bad", point to the exact line, name the risk it carries, and offer a fix or ask a question. Explain the why and say what is working too, so the author learns something and keeps their dignity.

git show feature/login^:login.html

Before you run it, say out loud what it will print. Then open the answer.

What it prints
login form
A vague comment like "this is bad" makes the author guess. Point to the line and the risk, the difference between "fix this" and "help me understand this".
4

Ask about the intent, not just the syntax. Sometimes the single most useful note is "why are we building this at all?". The question can save wasted code and open the reviewer to your feedback, because it treats the author as a thinker rather than someone who got something wrong.

git log --oneline -- git branch

Before you run it, say out loud what it will print. Then open the answer.

What it prints
abc1234 Add login form
Do not use the question to mask a criticism. A real question invites the author to explain, which the author responds to, unlike a verdict.
5

Finish by either approving or requesting changes on the pull request, with the specific note attached. If you requested changes, the author fixes it and the merge waits. If you approve, the branch merges and the review is done.

gh pr review 1 --approve

Before you run it, say out loud what it will print. Then open the answer.

What it prints
Reviewing pull request #1 Submitted a review that approves the changes.
An approval with no comment on a change you flagged is confusing. Either approve with a note, or request changes so the author knows something still needs to move.

Data Flow

Read the change, note specific feedback, ask about intent, then approve or request changes.
1 Read the diff
↓
2 Write specific notes
↓
3 Ask about intent
↓
4 Approve or request changes
Why this works
Be specific

Point to the exact line, explain the risk it carries, and offer a fix or a question. Vague comments slow everyone down and leave the author guessing.

Review the intent

Ask about the goal, not just the syntax. Sometimes the single most useful note is "why are we building this at all?", and that question can save a lot of wasted code.

Examples

Specific feedback beats a verdict

Bad:   "This is bad."
Good:  "Line 22 could overflow on large input. Add a check. Why are you using int here?"

A good note explains the why, asks a question instead of issuing an order, and says what's working too. It's the difference between "fix this" and "help me understand this." The author learns something and keeps their dignity.

Reviewing your own code first

What changed here?
Is that test still passing?
Did I leave a console.log in production?

Before you open a PR, read through your own diff once. You'll spot the obvious mistakes, typos, leftover debug output, a test you forgot to update, that a reviewer would call out anyway. Self-review short-circuits a slow back-and-forth and usually earns you a quicker, friendlier review.

When the review feels harsh

They're pushing back on the code,
not on you as a person.
Ask: "What is the real concern here?"

Separate your ego from the diff. Most blunt notes are hiding a genuine problem you can solve. Answer the problem, not the tone. Not every review is gentle, but almost every harsh one points at something real worth fixing.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← Setting up your first automated workflow
Previous Lesson
Setting up your first automated workflow
Next Lesson
Keeping main unbreakable with branch protection
Keeping main unbreakable with branch protection →