Pro Yearly is on sale from $80 to $50! »

Code review beyond code style - PHP Antwerp

Code review beyond code style - PHP Antwerp

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

October 25, 2017
Tweet

Transcript

  1. Code Reviews @hannesvdvreken @phpantwerp

  2. Hi, my name is Hannes.

  3. !

  4. None
  5. None
  6. Code reviews

  7. PSR-2 Laravel code style Symfony code style

  8. None
  9. None
  10. None
  11. None
  12. None
  13. None
  14. What’s a code review?

  15. git

  16. push commits review commits reply approve writer reviewer ↻

  17. push commits review commits reply approve ↻ writer reviewer

  18. git add -p git checkout -p WHAT MAKES A CODE

    REVIEW?
  19. $ git add -p diff --git a/composer.json b/composer.json index 55f40d7..c2cdaa7

    100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "get-stream/stream", "description": "A PHP client for Stream (https://getstream.io)", - "keywords": ["stream", "newsfeed", "feedly"], + "keywords": ["stream", "newsfeed", "feedly", "activity", "feed"], "homepage": “https://getstream.io", Stage this hunk [y,n,q,a,d,/,e,?]? WHAT MAKES A CODE REVIEW?
  20. None
  21. Why spend time on that?

  22. Submitter WHY SPEND TIME ON THAT?

  23. Reviewer WHY SPEND TIME ON THAT?

  24. Management WHY SPEND TIME ON THAT?

  25. None
  26. What should a writer do?

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

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

  33. None
  34. None
  35. None
  36. do ✓ WHAT SHOULD A REVIEWER DO?

  37. None
  38. None
  39. None
  40. None
  41. None
  42. None
  43. Language

  44. OMG IM A BIG FAN OF UR CODEZ LANGUAGE

  45. BRO, what iz up with dis? Ma mom cud v

    written bettr code LANGUAGE
  46. No politics LANGUAGE

  47. Can’t stand the person giving you feedback? LANGUAGE

  48. LANGUAGE

  49. LANGUAGE

  50. LANGUAGE

  51. None
  52. None
  53. None
  54. Wrapping up

  55. https://youtu.be/3Fn68v7JWKI

  56. Thank you! @hannesvdvreken @phpantwerp

  57. Time for questions. @hannesvdvreken @phpantwerp