๐Ÿ“ Git & GitHub

How to Do Code Review: A Team Guide ๐Ÿ”

P
Author
PyLand Team
๐Ÿ“…
Published
06.05.2026
โฑ๏ธ
Reading time
4 min
๐Ÿ‘๏ธ
Views
309
๐ŸŒณ
Level
Advanced

Code review is the process of checking another developer’s changes before they land in the main branch. One of the most valuable practices in team development.

Why Code Review Matters

  • ๐Ÿ› Catches bugs before production, not after
  • ๐Ÿ“š Spreads knowledge โ€” reviewer learns from the author and vice versa
  • ๐Ÿ’ฌ Documents decisions โ€” discussions in the PR stay forever
  • ๐ŸŽจ Maintains style โ€” code looks consistent regardless of who wrote it
  • ๐Ÿค Builds the team โ€” shared responsibility for quality

How to Review: The Reviewer’s Role

Step 1: Read the PR Description

Before looking at the code โ€” read the description. What changed? Why? That’s the context for understanding decisions.

Step 2: Open the Files Changed Tab

Here you’ll see a line-by-line diff:
- ๐ŸŸข Green (+) โ€” added lines
- ๐Ÿ”ด Red (-) โ€” removed lines
- โšช White โ€” context without changes

Step 3: Leave Comments

Hover over a line number โ€” a blue + button appears.

Three types of comments:

Required change:

There should be a null check here, otherwise we'll crash on an empty description.
Suggestion:
if description is None:
    description = ""

Suggestion (not required):

Suggestion: this could be written more concisely using the walrus operator,
but that's up to you โ€” the current version is fine too.

Question/clarification:

Why is the timeout 30 seconds here and not 10? Is that intentional?

Step 4: Choose Review Type

After adding all your comments, click Review changes:

Type When to use
Comment Minor questions, nothing critical
Approve โœ… All good, ready to merge
Request changes โŒ Important issues, changes needed

What to Check During Review

โœ… Must check

  • Logic: Does the code work correctly? Are all edge cases handled?
  • Security: Any SQL injections, XSS, unprotected data?
  • Tests: Are there tests for the new functionality?
  • PR description: Is it clear what was done and why?

๐Ÿ‘ Good to check

  • Performance: Any unnecessary database queries, N+1 problems?
  • Readability: Are variable and function names clear?
  • Duplication: Is someone reinventing something that already exists?

๐Ÿ”Ž If possible

  • Documentation: Is documentation updated if the API changed?
  • Style: Does the code follow project standards?

How to Write Good Comments

โŒ Bad

This is wrong.
Rewrite this.
Why did you do this???

โœ… Good

There's a potential issue here: if the list is empty, sorted() returns [],
but the next line expects at least one element.
I'd suggest adding a check: if not items: return None
This works, but there's a more idiomatic way using a list comprehension:
result = [item.name for item in items if item.active]
Leaving it as-is is also fine โ€” this is a suggestion, not a requirement.

Rule: A comment should explain what is wrong and why, not just say “bad”.

Review Tone: nit, suggestion, blocker

In professional teams it’s common to label the severity of a comment:

nit: better to name the variable `user_count` instead of `cnt`
(minor, can be ignored)

suggestion: could extract this logic into a separate function
(suggestion, not required)

blocker: there's no network error handling here, this will crash in production
(must fix before merge)

How to Respond to Review: The Author’s Role

Rule 1: Review is about the code, not about you

The comment “this function is too complex” doesn’t mean “you’re a bad developer”. The reviewer is helping to make the product better.

Rule 2: Respond to every comment

Fixed โ€” added a null check, see the new commit.
Good point, agreed. Renamed the variable.
Interesting idea. Leaving it for now because this is temporary code,
but I'll create an Issue to track it.

Rule 3: If you disagree โ€” explain why

I thought about this, but chose the current approach because [reason].
Happy to discuss if you want โ€” open to dialogue.

Rule 4: After making changes โ€” notify the reviewer

After a new push click Re-request review next to the reviewer’s name.
This sends a notification: “author updated the PR, please take another look”.

Common Review Mistakes

Reviewer mistakes

โŒ Nitpick bombing โ€” 50 minor comments about spaces and formatting
โ†’ Set up an auto-formatter instead of manual fixes

โŒ Silent Approve โ€” clicked Approve without reading
โ†’ If you don’t have time to review โ€” say so, let someone else look

โŒ Subjective demands โ€” “I don’t like this style”
โ†’ Review should be about correctness, not taste

Author mistakes

โŒ Huge PR โ€” 2000 lines of changes
โ†’ Break into small PRs, they’re easier to review

โŒ No description โ€” empty Description field
โ†’ Always fill in the PR description template

โŒ Ignoring comments โ€” pushed and merged yourself
โ†’ Respect the review process even when you’re in a hurry

Review in GitHub Desktop

GitHub Desktop doesn’t show the Code Review UI โ€” that’s done through the browser at github.com.

Workflow:
1. Got a PR link โ†’ opened in browser
2. Read the description โ†’ Files Changed tab โ†’ left comments
3. Review changes โ†’ chose type โ†’ Submit review
4. Author will see the notification in GitHub

Good Review = Good Team

Research shows that teams with a review culture:
- Find 60% more bugs before production
- Onboard new members faster
- Have lower technical debt

Review is an investment, not a waste of time.

Your reaction to the article

๐Ÿ’ฌ Comments (0)

๐Ÿ” Sign in to leave a comment
๐Ÿšช Login
๐Ÿ’ญ

No comments yet

Be the first to share your opinion about this article!

๐Ÿ”— Similar

Similar articles

Continue learning with these materials

๐Ÿ“

Undo and Revert in GitHub Desktop: Fix Mistakes Wโ€ฆ

A commit is not a point of no return. GitHub Desktop lets you rebuild a...

๐Ÿ“… 16.07.2026 ๐Ÿ‘๏ธ 359
๐Ÿ“

History, Diffs, and Web Commits on GitHub

GitHub lets you read repository history, inspect individual commit diffs, view the history of one...

๐Ÿ“… 16.07.2026 ๐Ÿ‘๏ธ 312
๐Ÿ“

Your First Git Commit

Your first commit starts with initializing a repository, configuring the author identity, and selecting the...

๐Ÿ“… 30.06.2026 ๐Ÿ‘๏ธ 343
๐ŸŽ“ Continue learning

Courses that cover this material

Visit the course to apply this material in practice.

Git & GitHub Desktop: Teamwork Without the Pain Open course curriculum