Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

A Second Set Of Eyes: Getting The Most From Code Reviews

27 views

Published on

Slides from Modern Web Meetup RTP April 2019

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

A Second Set Of Eyes: Getting The Most From Code Reviews

  1. 1. A Second Set Of Eyes Getting The Most From Code Reviews Ben McCormick WhatCounts Twitter: @_benmccormick Blog: http://benmccormick.org Newsletter: http://benmccormick.org/subscribe
  2. 2. Who Am I? • UI Dev Manager @ WhatCounts • Reviewing Code for > 10 years • Live in Durham • Blog @ benmccormick.org
  3. 3. What To Expect • Why This Talk? • Why Review Code? • How To Have Better Reviews • Creating A Code Review Culture • Q & A (as time allows)
  4. 4. Why Talk About Code Reviews? • Devs spend time on it (3+ hrs a week at Google) • It’s rarely taught or discussed • It’s a skill that can be improve • It can make our jobs better / worse
  5. 5. Why Review Code? • Better Code • Knowledge Sharing • Implementing Architecture • Creating A Feedback Loop
  6. 6. Better Code • Find Bugs • Suggesting better patterns • Nitpick Style
  7. 7. Knowledge Sharing • Micro Sharing - More people who understand a piece of code • Macro Sharing - Exposure to new patterns and ways of doing things “Why Review Code” Sophie Alpert https://sophiebits.com/2018/12/25/why-review-code.html
  8. 8. Implementing Architecture • Architecture is planned (or not) in design meetings and technical documentation • Code Reviews help flesh it out • Code Reviews are great places to challenge, discuss and improve architecture decisions or gaps • Especially good for less formal processes “A Philosophy Of Software Design” John Ousterhout https://amzn.to/2XxQM03
  9. 9. Feedback Loops Deliberate practice [is when] (1)your attention is focused tightly on a specific skill you’re trying to improve […] (2)You receive feedback so you can correct your approach to keep your attention exactly where it is most productive. - Cal Newport, Deep Work “Deep Work” Cal Newport https://amzn.to/2XCfn3Y
  10. 10. Why Review Code? (Summary) • Better Code • Knowledge Sharing • Implementing Architecture • Feedback Loops
  11. 11. How To Have Better Code Reviews • Get Better Code Reviews • Annotate Pull Requests • Make Atomic Pull Requests • Give Better Code Reviews • Radical Candor • Don’t just critique
  12. 12. Get Better Reviews: Annotate Pull Requests
  13. 13. Get Better Reviews: Atomic Pull Requests
  14. 14. Give Better Reviews: Radical Candor “Radical Candor” by Kim Scott https://www.radicalcandor.com/
  15. 15. Give Better Code Reviews: Don’t just critique • Ask questions • Affirm things that are well done • Make suggestions
  16. 16. How To Have Better Code Reviews (Summary) • Get Better Code Reviews • Annotate Pull Requests • Make Atomic Pull Requests • Give Better Code Reviews • Radical Candor • Don’t just critique
  17. 17. Create A Code Review Culture • Make Reviews Multi-Directional • Hold Reviewers Accountable • Get The Process Right
  18. 18. Multi-Directional Code Reviews • Senior -> Junior • Mentoring • Bug Catching • Junior -> Senior • Codebase Learning • Readability testing • Peer -> Peer • Architecture Discussion • Bug catching • “Lottery Bus” insurance
  19. 19. Accountability • This is about team culture • Reviewer and author should be equally responsible and accountable for code quality • (Accountability != blame)
  20. 20. Get The Process Right • Match technology to your process • Use Checklists • Leave margin for changes
  21. 21. Create A Code Review Culture (Summary) • Make Reviews Multi-Directional • Hold Reviewers Accountable • Get The Process Right
  22. 22. Ben McCormick WhatCounts Twitter: @_benmccormick Blog: http://benmccormick.org Newsletter: http://benmccormick.org/subscribe Questions?

×