Code review for Beginners and Experts: Tips & Tricks ukasz K - - PowerPoint PPT Presentation

code review for beginners and experts tips tricks
SMART_READER_LITE
LIVE PREVIEW

Code review for Beginners and Experts: Tips & Tricks ukasz K - - PowerPoint PPT Presentation

Code review for Beginners and Experts: Tips & Tricks ukasz K kol Who am I? Software Engineer Technical Team Leader Author of "Idiomatic Python Performance" (Apress) Speaker @ EuroPython, PyCon UK, PySS &


slide-1
SLIDE 1

Code review for Beginners and Experts: Tips & Tricks

Łukasz Kąkol

slide-2
SLIDE 2

Who am I?

  • Software Engineer
  • Technical Team Leader
  • Author of "Idiomatic Python Performance" (Apress)
  • Speaker @ EuroPython, PyCon UK, PySS & local meetups
  • Pythonic code vs. performance


http://lukkol.pl/performance/ep2018

  • Brace yourself, python2 is retiring


http://lukkol.pl/python3/pyconuk2018

slide-3
SLIDE 3

Agenda

  • Introduction
  • General tips & tricks
  • Different perspectives
  • Q&A / discussion
slide-4
SLIDE 4

Introduction

slide-5
SLIDE 5

What is the code review?

  • Software quality assurance step
  • Reading and analyzing source code
  • Performed by human
  • Not done by author*
  • Not done by manager
  • Everyone in the team


should both get and give code reviews

slide-6
SLIDE 6

Purpose of the code review

  • Finding defects
  • Finding better solutions
  • Quality at early stage
  • Improving code quality
  • Code ownership
  • Knowledge transfer
  • Reduces bus factor
slide-7
SLIDE 7

General tips & tricks

slide-8
SLIDE 8

Tooling

  • Use builtin code review tools
  • Use code style checking tools (pylint, pyflakes, pycodestyle, etc.)
  • Use code formatting tool (black)
  • Set up Continuous Integration
  • Add pre commit hook
slide-9
SLIDE 9

Tips & tricks for author

  • Be the first reviewer
  • Keep changes small
  • Annotate most important changes
  • If code is too complicated,


walk through it with reviewer

  • If you disagree with the reviewer,


take the discussion offline
 (remember about summarizing comment)

slide-10
SLIDE 10

Tips & tricks for reviewer

  • Read the ticket
  • Take your time
  • Limit time for code review
  • Look carefully for both logical and design mistakes
  • Test the code
  • Be professional and leave constructive feedback
slide-11
SLIDE 11

Different perspectives

slide-12
SLIDE 12

Author perspectives

Beginner / Newcomer Expert

slide-13
SLIDE 13

Reviewing beginner's code

  • Be polite and professional
  • Explain clearly what the mistake is about
  • Explain why is it better your way
  • Show them your appreciation
slide-14
SLIDE 14

Reviewing expert's code

  • Quidquid latine dictum sit, altum videtur
  • Don't take the code as perfect
  • Fountain of information
  • Don't be afraid to ask questions
slide-15
SLIDE 15

Thank you!

Idiomatic Python Performance Stay tuned - early 2020

http://bit.ly/2O4Kk0X Feedback http://lukkol.pl/ep2019-code-review Slides