Git & GitHub Course
Git & GitHub
/
Intermediate

Code Reviews

Definition

The systematic examination of computer source code intended to find mistakes overlooked in the initial development phase, improving the overall quality of software.

Explain Like I'm New

Before your code is allowed into the sacred `main` branch, another human must read it. They look for typos, logic errors, security flaws, and messy code. It's not about being mean, it's about catching bugs before they hit the customers.

Real World Example

You open a PR. Your senior developer reviews it and notices you left a `console.log(userPassword)` in the code. They request a change, saving the company from a massive security breach.

Common Use Cases

  • •Ensuring code quality
  • •Mentoring junior developers
  • •Sharing knowledge across the team

Interactive Example

Loading...
Console output will appear here...

Interview Questions

basic

  • On GitHub, how do you see exactly what lines of code were changed in a PR?

intermediate

  • What is the psychological best practice for leaving a code review comment?

Flash Cards

Question

See changed lines?

Click to reveal answer
Answer

Click on the 'Files changed' tab in the PR. It shows a visual 'Diff' (red lines for deleted code, green lines for added code).

Question

Psychological best practice?

Click to reveal answer
Answer

Critique the code, not the coder. Say 'This function might be slow if the array is large', rather than 'Why did you write this terrible function?'. Ask questions rather than giving demands.