SlideShare a Scribd company logo
Level Up Your Python
Code Reviews to
‘Ship It’ Faster
Syeda Kauser Inamdar
Software Engineer, LinkedIn
Tweet @codealatte
June 5, 2020
Agenda
1 Automate code review
2 Create a great pull request
3 Give effective feedback
What is code
review?
Benefits of code review
Find bugs early Share knowledge Maintain consistent
code
Comic from https://www.monkeyuser.com/2018/tech-debt/
Chaotic code
Black Hole
Wasted cycles going back
and forth about code style
and format
Style Guide
• Start off with PEP8,
which is a style guide
used within the Python
Community
• Helps maintain
consistent coding style
for the team
• Teams need to agree
on the style guide
flake8
• Wrapper which checks
for PEP8 compliance
against various python
linting tools
• Runs all tools in a single
command and displays
warnings per file
Result of applying flake8 on the code snippet
black
• The uncompromising
python code formatter
which auto-formats
code to make code
review faster
• Note that black is a
strict subset of PEP8
(except default line
length)
Result of applying black on the code snippet
With better
formatting,
the
submitter or
reviewer
should now
notice
there’s a
typo which
needs to be
fixed!
isort
• Library that sorts imports
alphabetically by default
adhering to specific
sections (standard library
imports, third-party
imports, own project
imports. . . )
• Improves import
readability
Result of applying isort on the code snippet
Integrate it into your workflow
pre-commit
• Manages installation and
execution of each hook
configured to automatically
apply every commit
• Tip – Apply black plugin first
and then flake8
• Enforces style consistency
before code is committed to
the repository
Setting up pre-commit
Running pre-commit
Failing pre-commit
Passing pre-commit
Code style is now enforced
with python tooling and
automation!
pre-commit
framework
pre-commit
framework
Negative review
Possible approach to respond to this negative review
Explain why you added
that functionality with
a comment and get
their feedback again.
This makes the decision
seem more inclusive
instead of single sided.
“I got feedback from multiple customers to include this option. I feel it helps for better user
experience if they can pick their two meals with the single script. How does that sound to you?”
Possible approach to respond to this negative review
“I believe we had discussed to have this option in our team meeting but I don’t see the decision listed
in the team meeting notes. Can we sync up to confirm the options then?”
If you don’t agree with
a reviewer’s decision,
have a discussion
within the pull request
and/or in person.Then
document the results of
that discussion within
the PR so it is tracked.
Pull Request
Submission
Checklist
A more complete submission
helps make for a more efficient
review!
1
Ensure you’ve
looked over the
code just before
creating the PR
as if you’re a
reviewer to catch
issues
Pull Request
Submission
Checklist
A more complete submission
helps make for a more efficient
review!
1
Ensure you’ve
looked over the
code just before
creating the PR
as if you’re a
reviewer to catch
issues
2
Ensure your code
is properly
formatted to
have a consistent
slate
Pull Request
Submission
Checklist
A more complete submission
helps make for a more efficient
review!
1
Ensure you’ve
looked over the
code just before
creating the PR
as if you’re a
reviewer to catch
issues
2
Ensure your code
is properly
formatted to
have a consistent
slate
3
Provide a clear
summary of
change in the
title and
description and
add tests where
needed
Pull Request
Submission
Checklist
A more complete submission
helps make for a more efficient
review!
1
Ensure you’ve
looked over the
code just before
creating the PR
as if you’re a
reviewer to catch
issues
2
Ensure your code
is properly
formatted to
have a consistent
slate
3
Provide a clear
summary of
change in the
title and
description and
add tests where
needed
4
Add
context/motivatio
n for the change
with supporting
documentation
where needed
Pull Request
Submission
Checklist
A more complete submission
helps make for a more efficient
review!
5
Identify concerns
around design or
implementation
you want
feedback on
Pull Request
Submission
Checklist
A more complete submission
helps make for a more efficient
review!
5
Identify concerns
around design or
implementation
you want
feedback on
6
Keep changes as
small as possible
within a single
PR. For example,
1 PR should solve
a single problem.
Otherwise, break
that PR to make it
more
manageable to
review
Pull Request
Submission
Checklist
A more complete submission
helps make for a more efficient
review!
5
Identify concerns
around design or
implementation
you want
feedback on
6
Keep changes as
small as possible
within a single
PR. For example,
1 PR should solve
a single problem.
Otherwise, break
that PR to make it
more
manageable to
review
7
Tag specific
people you’d like
to review the PR
Pull Request
Submission
Checklist
A more complete submission
helps make for a more efficient
review!
5
Identify concerns
around design or
implementation
you want
feedback on
6
Keep changes as
small as possible
within a single
PR. For example,
1 PR should solve
a single problem.
Otherwise, break
that PR to make it
more
manageable to
review
7
Tag specific
people you’d like
to review the PR
8
Proofread the PR
before submitting
to see if it makes
sense and
everything there
is as expected.
Then submit!
Things to
aim for as
an author
1 Acknowledge every review
comment
Things to
aim for as
an author
1 Acknowledge every review
comment
2
If you’re feeling overwhelmed with
comments, you can try to identify
those themes to improve on next
time. Alternatively sync up with the
reviewer in person to go through
the comments you need more
clarity on
Things to
aim for as
an author
1 Acknowledge every review
comment
2
If you’re feeling overwhelmed with
comments, you can try to identify
those themes to improve on next
time. Alternatively sync up with the
reviewer in person to go through
the comments you need more
clarity on
3
If the reviewers cannot come to a
consensus on the change, create a
meeting to discuss the change in
person and track the result in the
PR
Things to
aim for as
an author
1 Acknowledge every review
comment
2
If you’re feeling overwhelmed with
comments, you can try to identify
those themes to improve on next
time. Alternatively sync up with the
reviewer in person to go through
the comments you need more
clarity on
3
If the reviewers cannot come to a
consensus on the change, create a
meeting to discuss the change in
person and track the result in the
PR
4
Embrace reviews as a learning
opportunity – critical reviews are
inevitable, it’s all about how you
respond to them
What do you think of when you think of a code reviewer?
Supervillain Robot Facepalmer
What do you think of when you think of a code reviewer?
Supervillain Robot Facepalmer
What do you think of when you think of a code reviewer?
Supervillain Robot Facepalmer
How we should perceive a reviewer
Thinker Technologist Teacher
How we should perceive a reviewer
Thinker Technologist Teacher
Student Human
Negative review
Comment sounds
passive aggressive and
doesn’t explain why
that functionality isn’t
needed
Negative review
Even if ”burger” was
not an agreed upon
option, the phrasing is
a little harsh. Direct
language is part of
code review since we
want to “get to the
point”, but within this
comment’s context, it
could have had
reference to
documentation or
meeting notes which
solidified the point as
well.
Positive review
Asking a question
opens it up for
discussion.
Positive review
If unsure about
something, asking for
documentation is really
helpful.
Also explaining the why
behind something also
helps the submitter and
other reviewers get
more context around it.
Using “we” is highly
encouraged as it’s a
more collaborative
word.
Remember to give positive feedback too!
Code
Reviewer
Checklist
A high-level checklist- feel free
to add to it for your own
reviews!
1
Ensure you
understand
context of the
change. Simply
approving with a
“LGTM” without
having context
can have
unfortunate
consequences
Code
Reviewer
Checklist
A high-level checklist- feel free
to add to it for your own
reviews!
1
Ensure you
understand
context of the
change. Simply
approving with a
“LGTM” without
having context
can have
unfortunate
consequences
2
Ask questions around
the content of the
change (some
suggestions below)
• Does the feature
need to be
implemented?
• How does this
change impact the
larger scale
(team/organization/
company)?
• Does the code do
what it says it does?
• Is that the right way
to do it? Is it
following best
practices?
• Can we optimize it?
Code
Reviewer
Checklist
A high-level checklist- feel free
to add to it for your own
reviews!
1
Ensure you
understand
context of the
change. Simply
approving with a
“LGTM” without
having context
can have
unfortunate
consequences
2
Ask questions around
the content of the
change (some
suggestions below)
• Does the feature
need to be
implemented?
• How does this
change impact the
larger scale
(team/organization/
company)?
• Does the code do
what it says it does?
• Is that the right way
to do it? Is it
following best
practices?
• Can we optimize it?
3
Try to save nit-
picks until after
you’ve addressed
architecture and
design of the
submitted code
Code
Reviewer
Checklist
A high-level checklist- feel free
to add to it for your own
reviews!
1
Ensure you
understand
context of the
change. Simply
approving with a
“LGTM” without
having context
can have
unfortunate
consequences
2
Ask questions around
the content of the
change (some
suggestions below)
• Does the feature
need to be
implemented?
• How does this
change impact the
larger scale
(team/organization/
company)?
• Does the code do
what it says it does?
• Is that the right way
to do it? Is it
following best
practices?
• Can we optimize it?
3
Try to save nit-
picks until after
you’ve addressed
architecture and
design of the
submitted code
4
Can sometimes
phrase
suggestions as
questions to
open discussion
and give the
code submitter
more ownership
of the change
Code
Reviewer
Checklist
A high-level checklist- feel free
to add to it for your own
reviews!
5
Don’t just gloss
over test code
Code
Reviewer
Checklist
A high-level checklist- feel free
to add to it for your own
reviews!
5
Don’t just gloss
over test code
6
Support points
with
documentation
where
appropriate. For
example, when
trying to make a
piece of code
more pythonic,
you can put a link
to online
documentation
or even write a
simple code
snippet to
illustrate your
point
Code
Reviewer
Checklist
A high-level checklist- feel free
to add to it for your own
reviews!
5
Don’t just gloss
over test code
6
Support points
with
documentation
where
appropriate. For
example, when
trying to make a
piece of code
more pythonic,
you can put a link
to online
documentation
or even write a
simple code
snippet to
illustrate your
point
7
Re-read the PR
and your
comments before
publishing
Code
Reviewer
Checklist
A high-level checklist- feel free
to add to it for your own
reviews!
5
Don’t just gloss
over test code
6
Support points
with
documentation
where
appropriate. For
example, when
trying to make a
piece of code
more pythonic,
you can put a link
to online
documentation
or even write a
simple code
snippet to
illustrate your
point
7
Re-read the PR
and your
comments before
publishing
8
Remember to
sometimes offer
positive feedback
as well
Things to
aim for as
a reviewer
1
Provide timely feedback. Done in a
constructive manner, will help make
the review more efficient
Things to
aim for as
a reviewer
1
Provide timely feedback. Done in a
constructive manner, will help make
the review more efficient
2
Try to use more
collaborative/empathic language
where possible. It’s ok to be direct
to be efficient but language should
not be accusatory or degrading
Things to
aim for as
a reviewer
1
Provide timely feedback. Done in a
constructive manner, will help make
the review more efficient
2
Try to use more
collaborative/empathic language
where possible. It’s ok to be direct
to be efficient but language should
not be accusatory or degrading
3
There’s a balance between being
constructive and overly critical/nit-
picky. Try to find the balance for
you and the team
Things to
aim for as
a reviewer
1
Provide timely feedback. Done in a
constructive manner, will help make
the review more efficient
2
Try to use more
collaborative/empathic language
where possible. It’s ok to be direct
to be efficient but language should
not be accusatory or degrading
3
There’s a balance between being
constructive and overly critical/nit-
picky. Try to find the balance for
you and the team
4
Embrace reviews as a learning
opportunity – you may learn
something new from the submitted
code or other reviewers
Summary
Set your review up for success Submitters and reviewers are human Ship It Faster
Resources
1 http://bit.ly/pycoderevie
ws
2
https://ljvmiranda921.githu
b.io/notebook/2018/06/21/
precommits-using-black-
and-flake8/
3
https://www.michaelagreiler
.com/code-review-best-
practices/
4
https://hackernoon.com/wh
y-you-should-do-code-
review-e2642cfd1667
Thank youhttps://linkedin.com/in/syedakauserinamdar
Tweet @codealatte

More Related Content

Similar to Level Up Your Python Code Reviews to Ship It Faster - WWCodeDigital - 2020

Why Isn't Clean Coding Working For My Team
Why Isn't Clean Coding Working For My TeamWhy Isn't Clean Coding Working For My Team
Why Isn't Clean Coding Working For My Team
Rob Curry
 
Project Procurement PlanGuidelines to Establishing aProjec.docx
Project Procurement PlanGuidelines to Establishing aProjec.docxProject Procurement PlanGuidelines to Establishing aProjec.docx
Project Procurement PlanGuidelines to Establishing aProjec.docx
wkyra78
 

Similar to Level Up Your Python Code Reviews to Ship It Faster - WWCodeDigital - 2020 (20)

Leading Change from the Quality team
Leading Change from the Quality teamLeading Change from the Quality team
Leading Change from the Quality team
 
Code review guidelines
Code review guidelinesCode review guidelines
Code review guidelines
 
Why Isn't Clean Coding Working For My Team
Why Isn't Clean Coding Working For My TeamWhy Isn't Clean Coding Working For My Team
Why Isn't Clean Coding Working For My Team
 
How to make change happen in your organisation by talking your devs language
How to make change happen in your organisation by talking your devs languageHow to make change happen in your organisation by talking your devs language
How to make change happen in your organisation by talking your devs language
 
How to review a pull request
How to review a pull requestHow to review a pull request
How to review a pull request
 
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
 
Rapid Product Development
Rapid Product DevelopmentRapid Product Development
Rapid Product Development
 
Are your interns reviewing code? Andrew Lavers, ConFoo Montreal 2020
Are your interns reviewing code? Andrew Lavers, ConFoo Montreal 2020Are your interns reviewing code? Andrew Lavers, ConFoo Montreal 2020
Are your interns reviewing code? Andrew Lavers, ConFoo Montreal 2020
 
Lessons Learned in Product Ownership
Lessons Learned in Product OwnershipLessons Learned in Product Ownership
Lessons Learned in Product Ownership
 
Factors in Software Selection
Factors in Software SelectionFactors in Software Selection
Factors in Software Selection
 
Increasing Analytical Thinking In Agile Teams 1.5 (1).pptx
Increasing Analytical Thinking In Agile Teams 1.5 (1).pptxIncreasing Analytical Thinking In Agile Teams 1.5 (1).pptx
Increasing Analytical Thinking In Agile Teams 1.5 (1).pptx
 
Letters from the editor (TCUK12)
Letters from the editor (TCUK12)Letters from the editor (TCUK12)
Letters from the editor (TCUK12)
 
Facebook's Official Guide to Technical Program Management Candidates
Facebook's Official Guide to Technical Program Management CandidatesFacebook's Official Guide to Technical Program Management Candidates
Facebook's Official Guide to Technical Program Management Candidates
 
Project Procurement PlanGuidelines to Establishing aProjec.docx
Project Procurement PlanGuidelines to Establishing aProjec.docxProject Procurement PlanGuidelines to Establishing aProjec.docx
Project Procurement PlanGuidelines to Establishing aProjec.docx
 
eSavvy webinar: Top 5+1 Tips of How to Maximize the ROI of a CRM Investment
eSavvy webinar: Top 5+1 Tips of How to Maximize the ROI of a CRM InvestmenteSavvy webinar: Top 5+1 Tips of How to Maximize the ROI of a CRM Investment
eSavvy webinar: Top 5+1 Tips of How to Maximize the ROI of a CRM Investment
 
7 Questions You Should Ask A DevOps Consulting Company At The First Meeting  
7 Questions You Should Ask A DevOps Consulting Company At The First Meeting  7 Questions You Should Ask A DevOps Consulting Company At The First Meeting  
7 Questions You Should Ask A DevOps Consulting Company At The First Meeting  
 
Beyond SEO: copywriting for professionals
Beyond SEO: copywriting for professionalsBeyond SEO: copywriting for professionals
Beyond SEO: copywriting for professionals
 
Web2Expo NY 2009 Presentation
Web2Expo NY 2009 PresentationWeb2Expo NY 2009 Presentation
Web2Expo NY 2009 Presentation
 
Aligning Product Strategy with Customer Feature Requests
Aligning Product Strategy with Customer Feature RequestsAligning Product Strategy with Customer Feature Requests
Aligning Product Strategy with Customer Feature Requests
 
Agile testingandautomation
Agile testingandautomationAgile testingandautomation
Agile testingandautomation
 

Recently uploaded

How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 

Recently uploaded (20)

Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 

Level Up Your Python Code Reviews to Ship It Faster - WWCodeDigital - 2020

  • 1. Level Up Your Python Code Reviews to ‘Ship It’ Faster Syeda Kauser Inamdar Software Engineer, LinkedIn Tweet @codealatte June 5, 2020
  • 2. Agenda 1 Automate code review 2 Create a great pull request 3 Give effective feedback
  • 4. Benefits of code review Find bugs early Share knowledge Maintain consistent code
  • 6.
  • 8. Black Hole Wasted cycles going back and forth about code style and format
  • 9. Style Guide • Start off with PEP8, which is a style guide used within the Python Community • Helps maintain consistent coding style for the team • Teams need to agree on the style guide
  • 10. flake8 • Wrapper which checks for PEP8 compliance against various python linting tools • Runs all tools in a single command and displays warnings per file
  • 11. Result of applying flake8 on the code snippet
  • 12. black • The uncompromising python code formatter which auto-formats code to make code review faster • Note that black is a strict subset of PEP8 (except default line length)
  • 13. Result of applying black on the code snippet With better formatting, the submitter or reviewer should now notice there’s a typo which needs to be fixed!
  • 14. isort • Library that sorts imports alphabetically by default adhering to specific sections (standard library imports, third-party imports, own project imports. . . ) • Improves import readability
  • 15. Result of applying isort on the code snippet
  • 16. Integrate it into your workflow
  • 17. pre-commit • Manages installation and execution of each hook configured to automatically apply every commit • Tip – Apply black plugin first and then flake8 • Enforces style consistency before code is committed to the repository
  • 22. Code style is now enforced with python tooling and automation!
  • 23.
  • 25.
  • 26.
  • 29. Possible approach to respond to this negative review Explain why you added that functionality with a comment and get their feedback again. This makes the decision seem more inclusive instead of single sided. “I got feedback from multiple customers to include this option. I feel it helps for better user experience if they can pick their two meals with the single script. How does that sound to you?”
  • 30. Possible approach to respond to this negative review “I believe we had discussed to have this option in our team meeting but I don’t see the decision listed in the team meeting notes. Can we sync up to confirm the options then?” If you don’t agree with a reviewer’s decision, have a discussion within the pull request and/or in person.Then document the results of that discussion within the PR so it is tracked.
  • 31. Pull Request Submission Checklist A more complete submission helps make for a more efficient review! 1 Ensure you’ve looked over the code just before creating the PR as if you’re a reviewer to catch issues
  • 32. Pull Request Submission Checklist A more complete submission helps make for a more efficient review! 1 Ensure you’ve looked over the code just before creating the PR as if you’re a reviewer to catch issues 2 Ensure your code is properly formatted to have a consistent slate
  • 33. Pull Request Submission Checklist A more complete submission helps make for a more efficient review! 1 Ensure you’ve looked over the code just before creating the PR as if you’re a reviewer to catch issues 2 Ensure your code is properly formatted to have a consistent slate 3 Provide a clear summary of change in the title and description and add tests where needed
  • 34. Pull Request Submission Checklist A more complete submission helps make for a more efficient review! 1 Ensure you’ve looked over the code just before creating the PR as if you’re a reviewer to catch issues 2 Ensure your code is properly formatted to have a consistent slate 3 Provide a clear summary of change in the title and description and add tests where needed 4 Add context/motivatio n for the change with supporting documentation where needed
  • 35. Pull Request Submission Checklist A more complete submission helps make for a more efficient review! 5 Identify concerns around design or implementation you want feedback on
  • 36. Pull Request Submission Checklist A more complete submission helps make for a more efficient review! 5 Identify concerns around design or implementation you want feedback on 6 Keep changes as small as possible within a single PR. For example, 1 PR should solve a single problem. Otherwise, break that PR to make it more manageable to review
  • 37. Pull Request Submission Checklist A more complete submission helps make for a more efficient review! 5 Identify concerns around design or implementation you want feedback on 6 Keep changes as small as possible within a single PR. For example, 1 PR should solve a single problem. Otherwise, break that PR to make it more manageable to review 7 Tag specific people you’d like to review the PR
  • 38. Pull Request Submission Checklist A more complete submission helps make for a more efficient review! 5 Identify concerns around design or implementation you want feedback on 6 Keep changes as small as possible within a single PR. For example, 1 PR should solve a single problem. Otherwise, break that PR to make it more manageable to review 7 Tag specific people you’d like to review the PR 8 Proofread the PR before submitting to see if it makes sense and everything there is as expected. Then submit!
  • 39. Things to aim for as an author 1 Acknowledge every review comment
  • 40. Things to aim for as an author 1 Acknowledge every review comment 2 If you’re feeling overwhelmed with comments, you can try to identify those themes to improve on next time. Alternatively sync up with the reviewer in person to go through the comments you need more clarity on
  • 41. Things to aim for as an author 1 Acknowledge every review comment 2 If you’re feeling overwhelmed with comments, you can try to identify those themes to improve on next time. Alternatively sync up with the reviewer in person to go through the comments you need more clarity on 3 If the reviewers cannot come to a consensus on the change, create a meeting to discuss the change in person and track the result in the PR
  • 42. Things to aim for as an author 1 Acknowledge every review comment 2 If you’re feeling overwhelmed with comments, you can try to identify those themes to improve on next time. Alternatively sync up with the reviewer in person to go through the comments you need more clarity on 3 If the reviewers cannot come to a consensus on the change, create a meeting to discuss the change in person and track the result in the PR 4 Embrace reviews as a learning opportunity – critical reviews are inevitable, it’s all about how you respond to them
  • 43.
  • 44. What do you think of when you think of a code reviewer? Supervillain Robot Facepalmer
  • 45. What do you think of when you think of a code reviewer? Supervillain Robot Facepalmer
  • 46. What do you think of when you think of a code reviewer? Supervillain Robot Facepalmer
  • 47. How we should perceive a reviewer Thinker Technologist Teacher
  • 48. How we should perceive a reviewer Thinker Technologist Teacher Student Human
  • 49. Negative review Comment sounds passive aggressive and doesn’t explain why that functionality isn’t needed
  • 50. Negative review Even if ”burger” was not an agreed upon option, the phrasing is a little harsh. Direct language is part of code review since we want to “get to the point”, but within this comment’s context, it could have had reference to documentation or meeting notes which solidified the point as well.
  • 51. Positive review Asking a question opens it up for discussion.
  • 52. Positive review If unsure about something, asking for documentation is really helpful. Also explaining the why behind something also helps the submitter and other reviewers get more context around it. Using “we” is highly encouraged as it’s a more collaborative word.
  • 53. Remember to give positive feedback too!
  • 54. Code Reviewer Checklist A high-level checklist- feel free to add to it for your own reviews! 1 Ensure you understand context of the change. Simply approving with a “LGTM” without having context can have unfortunate consequences
  • 55. Code Reviewer Checklist A high-level checklist- feel free to add to it for your own reviews! 1 Ensure you understand context of the change. Simply approving with a “LGTM” without having context can have unfortunate consequences 2 Ask questions around the content of the change (some suggestions below) • Does the feature need to be implemented? • How does this change impact the larger scale (team/organization/ company)? • Does the code do what it says it does? • Is that the right way to do it? Is it following best practices? • Can we optimize it?
  • 56. Code Reviewer Checklist A high-level checklist- feel free to add to it for your own reviews! 1 Ensure you understand context of the change. Simply approving with a “LGTM” without having context can have unfortunate consequences 2 Ask questions around the content of the change (some suggestions below) • Does the feature need to be implemented? • How does this change impact the larger scale (team/organization/ company)? • Does the code do what it says it does? • Is that the right way to do it? Is it following best practices? • Can we optimize it? 3 Try to save nit- picks until after you’ve addressed architecture and design of the submitted code
  • 57. Code Reviewer Checklist A high-level checklist- feel free to add to it for your own reviews! 1 Ensure you understand context of the change. Simply approving with a “LGTM” without having context can have unfortunate consequences 2 Ask questions around the content of the change (some suggestions below) • Does the feature need to be implemented? • How does this change impact the larger scale (team/organization/ company)? • Does the code do what it says it does? • Is that the right way to do it? Is it following best practices? • Can we optimize it? 3 Try to save nit- picks until after you’ve addressed architecture and design of the submitted code 4 Can sometimes phrase suggestions as questions to open discussion and give the code submitter more ownership of the change
  • 58. Code Reviewer Checklist A high-level checklist- feel free to add to it for your own reviews! 5 Don’t just gloss over test code
  • 59. Code Reviewer Checklist A high-level checklist- feel free to add to it for your own reviews! 5 Don’t just gloss over test code 6 Support points with documentation where appropriate. For example, when trying to make a piece of code more pythonic, you can put a link to online documentation or even write a simple code snippet to illustrate your point
  • 60. Code Reviewer Checklist A high-level checklist- feel free to add to it for your own reviews! 5 Don’t just gloss over test code 6 Support points with documentation where appropriate. For example, when trying to make a piece of code more pythonic, you can put a link to online documentation or even write a simple code snippet to illustrate your point 7 Re-read the PR and your comments before publishing
  • 61. Code Reviewer Checklist A high-level checklist- feel free to add to it for your own reviews! 5 Don’t just gloss over test code 6 Support points with documentation where appropriate. For example, when trying to make a piece of code more pythonic, you can put a link to online documentation or even write a simple code snippet to illustrate your point 7 Re-read the PR and your comments before publishing 8 Remember to sometimes offer positive feedback as well
  • 62. Things to aim for as a reviewer 1 Provide timely feedback. Done in a constructive manner, will help make the review more efficient
  • 63. Things to aim for as a reviewer 1 Provide timely feedback. Done in a constructive manner, will help make the review more efficient 2 Try to use more collaborative/empathic language where possible. It’s ok to be direct to be efficient but language should not be accusatory or degrading
  • 64. Things to aim for as a reviewer 1 Provide timely feedback. Done in a constructive manner, will help make the review more efficient 2 Try to use more collaborative/empathic language where possible. It’s ok to be direct to be efficient but language should not be accusatory or degrading 3 There’s a balance between being constructive and overly critical/nit- picky. Try to find the balance for you and the team
  • 65. Things to aim for as a reviewer 1 Provide timely feedback. Done in a constructive manner, will help make the review more efficient 2 Try to use more collaborative/empathic language where possible. It’s ok to be direct to be efficient but language should not be accusatory or degrading 3 There’s a balance between being constructive and overly critical/nit- picky. Try to find the balance for you and the team 4 Embrace reviews as a learning opportunity – you may learn something new from the submitted code or other reviewers
  • 66. Summary Set your review up for success Submitters and reviewers are human Ship It Faster

Editor's Notes

  1. Finds bugs early on Educates both submitter and reviewer about software engineering best practices around design and implementation Encourages collaboration
  2. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/
  3. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/
  4. https://www.pexels.com/photo/sky-space-dark-galaxy-2150/
  5. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/
  6. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/
  7. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/
  8. can also add custom behavior to write your own hook
  9. Finds bugs early on Educates both submitter and reviewer about software engineering best practices around design and implementation Encourages collaboration
  10. Finds bugs early on Educates both submitter and reviewer about software engineering best practices around design and implementation Encourages collaboration
  11. Mention autopep8 as well
  12. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/ IMAGE WITH BOOTS FROM - https://www.pexels.com/photo/crop-person-in-autumn-boots-walking-on-wet-wooden-logs-3932882/
  13. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/ IMAGE WITH BOOTS FROM - https://www.pexels.com/photo/crop-person-in-autumn-boots-walking-on-wet-wooden-logs-3932882/
  14. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/
  15. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/
  16. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/
  17. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/
  18. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/
  19. Give example about for loop -> list comprehension or db connection handler -> context manager
  20. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/
  21. https://www.reddit.com/r/ProgrammerHumor/comments/a7m8zq/technical_debt/