Let's start from the beginning

Code review is systematic examination of computer source code

Main goal

Increase the software quality

Company benefits

  • Increase software quality
  • Make code maintainable
  • Create team foundations
  • ...

Career benefits

  • Learn from peers
  • Gain knowledge about your business
  • Helps mentoring (mentor & mentee)
  • ...

Personal benefits

  • Learn the value of constructive criticism
  • Improves your soft power skills
  • Learn how to give feedback
  • ...

Types of Code Review

Formal Code Review

Lightweight Code Review

  • Pair programming
  • Over the shoulder
  • Email pass-around
  • Informal walkthrough
  • Group review
  • Tool Assisted
    • pastebin, gists, specific tools

Tool Assisted

  • Pull Request
  • Commit-by-commit

Planification

Commits

Top commits Github

  • "Update README.md"
  • "Fix"
  • "Tests"
  • "*** empty log message ***"

Choose reviewer

None

Who developer wants

Specialist

Random

Cross-Platform

To-Do list for review

  • Write a good title and description
    • Remember good commits?
  • Reasonable due time
  • Do you have a Code Review template?
  • Help to review it
    • Could you provide some screenshots?
    • Ask for specific feedback
    • Explain how to test it (screenshots, gifs, APKs...)
  • Review your own code before to start

Reviewing

Type of reviewers

Best Friend Forever

  • Doesn't write meaningful comments
  • Doesn't look very deep
  • Just approves to unlock the ticket

Citadel Maesters

  • Everything need to approved by them
  • They are the only authority for decisions

Carefree

  • Approves to avoid to look the code
  • Approves after someone else approves
  • Thinks Code Reviews aren't helpful
  • Thinks Code Reviews are just a formality

Son of the incest

  • Thinks he has all the truth
  • His solutions is the best, always
  • Any change he suggests should be done
  • He is condescend to his peers

The King's hand

  • Cares about software quality
  • Knows he could learn from peers
  • Knows his comments could help someone
  • Respect company, code and developers

Type of reviewers

Who you wanna be?

Preparation to review

To-Do list for reviewers

  • Read the issue
  • How could you resolve it?
    • What problems could you have?
  • Check out the code
    • git stash
    • Second repo
  • And most important…

Take a coffee

What not to look at

  • Formatting and code style
    • Automation
  • Further than diff
    • Create a technical debt

What not to look at

  • Formatting and code style
    • Automation
  • Further than diff
    • Create a technical debt
    • Don't force the Boyscout rule
  • Word by word
    • Everyone has their own taste about code

Don't be Cersei

What to look at

  • What's important to your team?
  • How it solves the problem
    • Aha! Effect
  • Tests
  • Usability Code

Usability code

Usabilitiy code

  • Extensible
  • Mantenible
  • Understandable

Usabilitiy code

  • High Cohesion
  • Low Coupling

What to looking for

  • Design Patterns
  • Abstractions
  • Good data structures
  • Reuse warning
  • SOLID
  • Agreements (modifiable)
  • ...

Commenting

Hate the code. Love the coder

Humour

(With caution)

You have fixed Continous Integration
Have you used a color salmon-pink-light-3 where it was clear we need a salmon-pink-light-4?

Emojis

  • 🤔 Question
  • ☝️ Request
  • 🚧 Work in progress
  • 💩 Need work
  • ...

Ego

Every decision about code reviews has to take into account that there is a lot of ego and prideinvolved both on the side of the developer and reviewer
What a ego is?
The argentinian that everyone has inside
There aren't enough swear-words in the English language, so now I'll have to call you perkeleen vittupää just to express my disgust and frustration with this crap Linus Torvalds

Receiving feedback

Step out of your comfort zone

  • Be grateful for the feedback
  • You are not your code
  • Be open-minded
  • Written comments looks ruder
  • Breath 10 times before to reply
  • Think about their vocabulary
Hodor, hodor, hodor, hodor, hodor, hodor, hodor, hodor, hodor, hodor...

Problems in Targaryen Consulting

Wrapping up

I's not for everyone

It can break your team

Be thankful for the feedback

Use it to improve your company, your code and yourself

Disclaimer

Nobody is perfect,
but a Team can be

Nobody is perfect,
but a Team can be