Skip to content
hdayakar edited this page Jul 10, 2018 · 1 revision

Code review

A formal assessment of code with the intention of instituting change if necessary.

Why?

  • Readability
  • Architecture
  • Sharing knowledge
  • Bugs

Pair programming

  • driver
  • navigator

Mob programming

  • driver
  • multiple navigator

Egoless programming

Developers need a robust enough ego to trust and defend their work, but not so much ego that they reject suggestions for better solutions. Similarly, the egoless reviewer should have compassion and sensitivity for their colleagues, if only because their roles will be reversed one day.

Source: Humanizing peer reviews, karl e. wiegers

The ten commandments of egoless programming

  1. understand and accept that you will make mistakes.
  2. You are not your code.
  3. No matter how much "karate" you know, someone else will always know more.
  4. Don't rewrite code without consultation.
  5. Treat people who know less than you with respect, deference, and patience.
  6. The only constant in the world is change.
  7. The only true authority stems from knowledge, not from position
  8. Fight for what you believe, but gracefully accept defeat.
  9. Don't be "the guy in the room"
  10. Critique code instead of people - be kind to the coder, not to the code.

What to look for during a code review

  • Unhappy paths
  • Tests added
  • Feature implemented according to specs
  • Performance
  • Security

Code review etiquette

  • Don't jump to conclusions
  • Communicate clearly
  • Use examples
  • Thank you
  • Gifs

Getting started

  • Introduce branching
  • Automate menial tasks like code style checks and linting
  • Let everyone participate
  • Give everyone the right to merge

Improving code reviews

  • Code and functional reviews
  • Get a 3rd opinion
  • Keep changes small
  • Don't trust the developer
  • Review using your favourite tool
  • Shared vision

Architectural exploration

  • Take notes
  • Schedule a meeting
  • 1 hour
  • Present and discuss

With code reviews... You own the code... As a team!