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

Code review beyond code style - PHP UK Conference

Code review beyond code style - PHP UK Conference

Reviewing code can feel like a secondary task. Discussing code can be easy though,
if you leave out syntax details. Following a couple of guide lines for pull requests can make code reviewing much easier.

Some code style rules can drastically reduce the mental overhead needed to understand code changes. Furthermore this talk will give some general guidelines on how to give feedback on PRs as a peer developer or coworker. These rules are not to keep for yourself, share them with your peers and your life will get easier.

39eb3f3d313b13f05534e496285040b8?s=128

Hannes Van De Vreken

February 17, 2017
Tweet

More Decks by Hannes Van De Vreken

Other Decks in Technology

Transcript

  1. Code reviews @hannesvdvreken @PHPUKConference

  2. Hi, my name is Hannes.

  3. !

  4. madewithlove.be

  5. Code reviews

  6. What’s a code review?

  7. push commits review commits reply approve

  8. push commits review commits reply approve

  9. git add -p WHAT MAKES A CODE REVIEW?

  10. Why spend time on that?

  11. Submitter WHY SPEND TIME ON THAT?

  12. Reviewer WHY SPEND TIME ON THAT?

  13. Management WHY SPEND TIME ON THAT?

  14. @PHP_CEO YOU THINK DEPLOYING HUNDREDS OF TIMES A DAY IS

    COOL? WE DEPLOY *INFINITY* TIMES A DAY BY CUTTING OUT THE MIDDLEMAN AND EDITING LIVE CODE
  15. What should a submitter do?

  16. None
  17. Intermezzo: code style

  18. PSR-2 (soon PSR-12) Symfony code style

  19. None
  20. multiline_array_trailing_comma

  21. None
  22. phpdoc_params align_double_arrow align_equals

  23. Braces

  24. None
  25. None
  26. new_with_braces

  27. None
  28. None
  29. What should a reviewer do?

  30. don’ts ❌ WHAT SHOULD A REVIEWER DO?

  31. do ✓ WHAT SHOULD A REVIEWER DO?

  32. None
  33. Language

  34. LANGUAGE

  35. None
  36. None
  37. OMG I'M A BIG FAN OF UR CODES LANGUAGE

  38. LANGUAGE

  39. LANGUAGE

  40. LANGUAGE

  41. None
  42. Wrapping up

  43. Thank you! https:/ /joind.in/talk/7a944 @hannesvdvreken @PHPUKConference

  44. Time for questions. @hannesvdvreken @PHPUKConference