Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Code Reviews

David Majda
February 20, 2015

Code Reviews

We’ll look at code reviews both from the author’s and reviewer’s side. How to prepare a pull request that gets reviewed quickly and whose review is pleasant? And how to perform reviews that are both efficient and useful? Along the way we'll discuss some common anti-patterns in Jut’s code which good reviews can prevent.

Presented at internal Brews & Clues session at Jut.

David Majda

February 20, 2015
Tweet

More Decks by David Majda

Other Decks in Programming

Transcript

  1. Code Reviews
    How to get an instant +1 and make
    reviewers love you
    David Majda (@dmajda)
    Feb 20, 2015

    View Slide

  2. Intro

    View Slide

  3. View Slide

  4. Preparing PRs
    Reviewing PRs
    Code smells

    View Slide

  5. Preparing PRs

    View Slide

  6. Make PRs small

    View Slide

  7. Easy to review
    Don’t rot so quickly
    Less conflicts
    Less breakage

    View Slide

  8. Atomic
    Incremental
    Features / Refactoring / Formatting
    Controversial / Non-controversial

    View Slide

  9. View Slide

  10. View Slide

  11. Advise reviewers

    View Slide

  12. State
    Assumptions
    Focus areas

    View Slide

  13. View Slide

  14. View Slide

  15. Use commit
    messages

    View Slide

  16. http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

    View Slide

  17. Reviewing PRs

    View Slide

  18. Do I get it?

    View Slide

  19. Checklist

    View Slide

  20. High-level

    View Slide

  21. Best approach & design?
    Proper level of abstraction?
    Change isolated?

    View Slide

  22. Mid-level

    View Slide

  23. Already seen this?
    Easy to maintain?
    Easy to extend?
    Not overengineered?
    Boy scout rule?

    View Slide

  24. Low-level

    View Slide

  25. Are errors handled?
    Covered by tests?
    Follows coding style?
    Bugs: other occurrences?

    View Slide

  26. Code smells

    View Slide

  27. Long functions

    View Slide

  28. View Slide

  29. No modularity

    View Slide

  30. No interfaces

    View Slide

  31. That’s it!

    View Slide