Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Zen Code Reviews
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Xavier F. Gouchet
PRO
September 04, 2017
Video
Programming
0
15
Zen Code Reviews
Xavier F. Gouchet
PRO
September 04, 2017
Tweet
Share
Video
More Decks by Xavier F. Gouchet
See All by Xavier F. Gouchet
Writing a Kotlin Compiler Plugin
xgouchet
PRO
0
53
Being an ethical software engineer
xgouchet
PRO
0
320
Libérez votre créativité
xgouchet
PRO
0
140
Unleash your Programming Creativity
xgouchet
PRO
0
200
Demystifying the Test Pyramid
xgouchet
PRO
1
640
Successfully Publishing a Tested, Upgradeable and Documented Open Source Library
xgouchet
PRO
0
120
Property Based Testing in Practice
xgouchet
PRO
0
97
Develop your CI tools
xgouchet
PRO
2
450
How to write a safe and reliable Open Source Library
xgouchet
PRO
1
310
Other Decks in Programming
See All in Programming
今から始めるClaude Code超入門
448jp
8
8.6k
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
690
CSC307 Lecture 09
javiergs
PRO
1
830
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
610
AI & Enginnering
codelynx
0
110
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.1k
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
130
CSC307 Lecture 03
javiergs
PRO
1
490
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
560
Featured
See All Featured
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
160
Optimising Largest Contentful Paint
csswizardry
37
3.6k
The Language of Interfaces
destraynor
162
26k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
57
Automating Front-end Workflow
addyosmani
1371
200k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
93
Practical Orchestrator
shlominoach
191
11k
Code Reviewing Like a Champion
maltzj
527
40k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
Amusing Abliteration
ianozsvald
0
100
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
380
Transcript
ZEN CODE REVIEWS THE WAY TOWARDS PAINLESS CODE REVIEWS Droidcon
Berlin 2017 1
ABOUT… XAVIER F. GOUCHET ANDROID ARCHITECT AT ‘MR TOOLS’ /
CI ADMIN / UT ADVOCATE ON ALL SOCIAL NETWORKS @XGOUCHET 2.1
WHO USES CODE REVIEW HERE ? ♫ Put your hands
in the air ♪ — Placebo 3
CODE REVIEWS @ DEEZER 18 Android developers 3 main repositories
Varied experiences and skills 4
WHY ? THE PURPOSES OF CODE REVIEWS 5
FIND DEFECTS EARLY Logic fallacies Typos, spelling Edge cases Potential
technical debt 6
HARMONIZE THE CODE BASE Code style Naming conventions Architecture Libraries
7
GENERATE DISCUSSION AROUND… Choices Algorithm Data Structure Architecture Libraries Features
Best practices 8
TEAM BUILDING Cohesion Trust Lower “Linkedin factor” Asynchronous Pair Programming
9
SHARE KNOWLEDGE Onboard junior / new developers Everyone has something
to teach Everyone has something to learn 10
DOWNSIDES OF CODE REVIEW More time spent per ticket /
less time spent delivering feature Senior developer frustration 11
WHAT ? THE DIFFERENT TYPES OF CODE REVIEWS 12
“AUTOMATIC” CODE REVIEW Static Analysis Android Lints Findbugs, Checkstyle, PMD
Detekt, ktlint Tests (Unit, Integrated, Functionnal) 13
PRE-COMMIT Pro Quality ensured before merge All code must be
reviewed Cons Productivity impact Back & forth Hell ™ 14
POST-COMMIT Pro Continuous development Limit git conflicts Cons Bug can
ship to production Resolution can become non trivial afterwards 15
OPTIONAL CODE REVIEWS by commit author by commit length by
files modified random checks … ? 16
PAIR REVIEW WITH ANOTHER DEVELOPER Provide a single feedack Compare
different viewpoints Tone down negative feedbacks 17
CODE REVIEW MEETING WITH THE AUTHOR 3 to 7 attendees
Only for non trivial reviews Mentor the author Get in depth view Discuss alternatives Immediate feedback 18
HOW ? THE DOS AND DONTS OF CODE REVIEW 19
WRITING REVIEWABLE CODE Keep the commits short git add --patch
/ git add -p Comment the code Use a proper commit message CR Brief for non trivial commits Link to the ticket 20
BEFORE SUBMITTING, REVIEW YOUR OWN CODE Find easy to spot
issues Typos Commented code Duplicates / possible refactoring Copy / Paste errors Take a step back on your code 21
COMMENTING ON ISSUES “If you can't understand that, then yes,
you're crazy. Or just terminally stupid.” — Linus 22
BE PRECISE : WHAT IS THE PROBLEM ? “THIS CODE
IS BAD !” ✗ “THIS LINE COULD CAUSE A MEMORY LEAK…” ✔ 23
ARGUMENT : WHY IS IT A PROBLEM ? “OBVIOUSLY!” ✗
“… BECAUSE THE ACTIVITY REFERENCE IS RETAINED…” ✔ 24
BE HELPFUL : HOW TO FIX THE PROBLEM ? “DEAL
WITH IT!” ✗ “… YOU COULD INSTEAD USE A WEAKREFERENCE.” ✔ 25
DEFINE CRITICITY : HOW IMPORTANT IS THE ISSUE ? “…”
✗ “IT’S NOT CRITICAL, BUT MUST BE FIXED IN A LATER COMMIT BEFORE THE RELEASE CANDIDATE NEXT WEEK.” ✔ 26
EXAMPLES “The name of this variable is ambiguous. You could
rename it as …” “I don’t think this method should be in this class because it’s outside of the class’s responsibility.” “This rule has many edge cases, you should add more unit tests.” 27
VOTING DOWN Avoid blocking commits unnecessarily Always make the reasons
clear Make a full review If an issue has already been raised, don't comment just to say “+1” 28
RECEIVING CRITIQUE Take a step back Stay humble Motivate your
choices Accept the critique (even if it means more work for you) 29
OVERALL BEHAVIOR Stay open minded Make it about the code,
not the people Don't start the flame war Share your knowledge Give as much as you receive 30
GOING FURTHER ? CODEREVIEW.STACKEXCHANGE.COM 31
THANKS FOR YOUR ATTENTION ANY QUESTION ? 32