Effective Code Reviews
International PHP Conference 2018, Berlin
Moin and hello
Frank SonsFrank Sons  FrankS FrankS
http://code-quality.dehttp://code-quality.de
Wait, why are you here?
Anyone not doing code reviews?Anyone not doing code reviews?
This is not about tools!This is not about tools!
The good news...
„Peer code reviews are the single biggest
thing you can do to improve your code.“
„Peer code reviews are the single biggest
thing you can do to improve your code.“
Jeff Atwood – @codinghorror
A (very) small Agenda
The Status Quo of most code reviewsThe Status Quo of most code reviews
Let’s make it more effectiveLet’s make it more effective
Status quo of most ReviewsStatus quo of most Reviews
MindsetMindset
IntentionIntention
ResultsResults
Developer Ego
Who likes to be criticized?Who likes to be criticized?
“That’s not my code!”“That’s not my code!”
Ofc, it’s your choice...
„Everyone has the right and
freedom to totally suck in private“
„Everyone has the right and
freedom to totally suck in private“
Jeff Atwood – @codinghorror
MindsetMindset
IntentionIntention
ResultsResults
What is your Intention?
Why are you reviewing your code?Why are you reviewing your code?
What are you looking for?What are you looking for?
Main Motivation for reviews?
Well, let’s look at the real results
MindsetMindset
IntentionIntention
ResultsResults
Are you tracking your Results?
Fixing right now or later?Fixing right now or later?
Different opinions?Different opinions?
How successful are your reviews?How successful are your reviews?
So what do we get?
Results depend on experience, timing and
motivation of the reviewing developer!
Results depend on experience, timing and
motivation of the reviewing developer!
Let’s make it effectiveLet’s make it effective
MindsetMindset
IntentionIntention
ResultsResults
Leave your ego at the door
„Attempt to be awesome in public
and embrace the suck!“
„Attempt to be awesome in public
and embrace the suck!“
Jeff Atwood – @codinghorror
Forget about “your” code
Share the knowledgeShare the knowledge
The Team is responsibleThe Team is responsible
Team reviews are a good start
MindsetMindset
IntentionIntention
ResultsResults
The intention matters
Why are you reviewing your code?Why are you reviewing your code?
What are you looking for?What are you looking for?
Understanding is important
Pick the right method...
Pull requests?Pull requests?
Pair Programming?Pair Programming?
Code Review meetings?Code Review meetings?
Create a coding guideline
Don’t add stuff you can check with toolsDon’t add stuff you can check with tools
Let the team create itLet the team create it
It’s a living documentIt’s a living document
MindsetMindset
IntentionIntention
ResultsResults
Keep track of results
Make sure you have follow upsMake sure you have follow ups
Keep discussions separate from the reviewKeep discussions separate from the review
Not everything needs to be fixed at onceNot everything needs to be fixed at once
Create a review checklist
Use your guidelines as a baseUse your guidelines as a base
Checklists are great for reportsChecklists are great for reports
Make your reviews effective!
Leave your ego at the doorLeave your ego at the door
Have a guidelineHave a guideline
Follow up on your resultsFollow up on your results
No matter what...
„Peer code reviews are the single biggest
thing you can do to improve your code.“
„Peer code reviews are the single biggest
thing you can do to improve your code.“
Jeff Atwood – @codinghorror
Questions? Feedback?
Links
● http://blog.codeclimate.com/blog/2013/10/09/unexpected-outcomes-of-code-reviews/
● http://blog.ptsecurity.com/2012/08/code-review-implemented-into-development.html
● https://blog.codinghorror.com/code-reviews-just-do-it/
● https://www.slideshare.net/codinghorror/how-to-stop-sucking-and-be-awesome-instead
● https://martinfowler.com/bliki/CodeOwnership.html

Effective Code Reviews (IPC 2018)