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.

Increasing code quality with code reviews (poetry version)

2,397 views

Published on

Published in: Technology
  • Be the first to comment

Increasing code quality with code reviews (poetry version)

  1. 1. Increase Code Quality with Code Reviews David Stockton SkiPHP Conference 2014
  2. 2. Increase Code Quality with Code Reviews (Poetic Edition) David Stockton SkiPHP Conference 2014
  3. 3. What is a Code Review?
  4. 4. A Code Review Is Making Your Code Better Than It Would Be Without !
  5. 5. What is a code review? A program looking at your code
  6. 6. Skynet was started Code Review Reviewing Code That was its own code
  7. 7. What is a code review? Looking at someone else’s code
  8. 8. I see what you did Your code sucks worse than ever Undo that crap now!
  9. 9. What is a code review? Someone else looking at your code
  10. 10. I did that because I had a real good reason I’ve forgotten it.
  11. 11. Common Ways to Do Code Reviews
  12. 12. … And why those ways don’t work.
  13. 13. These are the things I’ve tried, I’ve tried These are the things I’ve tried.
  14. 14. Ways to do Code Reviews Email code or diffs
  15. 15. Code review email. Automatic filtering. Deleted. Unread.
  16. 16. Email Code Reviews Create a diff, copy/ paste code into an email
  17. 17. Mama Mia, Mama Mia, Mama Mia, let me go! This is what you do When you’ve too much time on your hands And nothing really matters. Anymore.
  18. 18. … and then? Send to people you want to review your code
  19. 19. Selecting my list My code review is sending Sorry, reviewers.
  20. 20. Selecting my list My code review is sending Sorry reviewers.
  21. 21. … and then? They write back.
  22. 22. I got a reply! What did they think of my code? I hate them, I think. :(
  23. 23. ERMAHGERD! YER CODEZ SUCKZ!
  24. 24. My blood, sweat and tears Torn to ribbons in three words. Your. Code. Sucks.
  25. 25. Reply back. … Maybe.
  26. 26. I waited to hear. I should check my spam filter Nope, it is empty.
  27. 27. Don’t you... Response never comes.
  28. 28. Poem too long to fit, sorry... There once was a man from Nantucket Whose code reviews told developers to chuck it They’d read it and weep And Crap code they’d keep As they told the reviewer to go
  29. 29. … Forget about me Or it’s ignored.
  30. 30. Expected response Got none for my code review Why should I bother?
  31. 31. You got me right in the feels Text feedback taken in the most possible negative way possible.
  32. 32. You said my code sucks Why do you h a t e me so much? You are a huge jerk!
  33. 33. What a jerk! From: Jake Developer! To: Byron Programmer! Subject: Code Review for foo.php! ! Have you considered IOC for this? The current solution leads to a lack of extensibility which will probably bite us later.! ! Also, two of the methods are missing doc comments and we need to put those
  34. 34. What a jerk! From: Jake Developer! To: Byron Programmer! IOC? WTH does thefor Subject: Code Review International Olympic foo.php! ! Committee have to do with Have you anything? IOC for considered this? The current solution leads to a lack of
  35. 35. WTH does he know! From: Jake Developer! To: Byron Programmer! Subject:extensibility. Why Lack of Code Review for foo.php! don’t you write the stupid ! thing yourself? Have you considered IOC for this? The current solution leads to a lack of
  36. 36. D to the B! From: Jake Developer! To: Byron Programmer! Subject: Code Review for foo.php! Bite Us? BITE ME! ! Have you considered IOC for this? The current solution leads to a lack of
  37. 37. ...and the horse you rode in on! From: Jake Developer! To: Byron Programmer! Subject: Code Review for Missing DOC comments? foo.php! Pick many !nits lately? Have you considered IOC for this? The current solution leads to a lack of
  38. 38. Picking my battles. From: Jake Developer! To: Byron Programmer! Subject: Code Review for foo.php! BALETED! ! Have you considered IOC for this? The current solution leads to a lack of
  39. 39. Ways to do code reviews Evaluate Via Repo Diff
  40. 40. It’s just me… and me now Usually done by one person
  41. 41. Lonely is the dev Reviewing Committed Code What is the point now?
  42. 42. Vacation? What’s vacation? Requires Diligence
  43. 43. I checked in a LOT You didn’t say anything. What is vay-cay-shun?
  44. 44. ...and the bottle makes... ...and a small team
  45. 45. Didn’t we cover this? Problems sent to dev via email
  46. 46. Yes, yes we did. See previous section for email problems.
  47. 47. Yes, yes we did. Second verse, same as the first.
  48. 48. There’s 24 hours in a day... Large burden for single developer
  49. 49. Weight of the world is Is on my aching shoulders Must improve posture
  50. 50. It’s for your own good. I swear. Developer usually very senior to team
  51. 51. Why won’t everyone Recognize my super-brain! I are the smartest!
  52. 52. Ways to do code reviews Group Review in Conference Room
  53. 53. Meetings are great tools To help everyone do Just about nothing.
  54. 54. Movie night! Gather developers around a TV
  55. 55. Worst plot evAr! I checked the reviews Rotten Tomatoes Gives It Code Review: Zero Stars
  56. 56. Time… is (not) on my side… Takes up a lot of time
  57. 57. Meetings are great tools To help everyone do Just about nothing.
  58. 58. People who enjoy meetings... Yet another meeting.
  59. 59. …should not be in charge… Developer can feel attacked.
  60. 60. Why’s everyone Always picking on me? Cuz I code like a chump And I don’t test anything
  61. 61. … of anything. Needs a moderator
  62. 62. Just like herding cats So too is the job of the Moderator guy.
  63. 63. After meetings, second favorite thing Needs a note taker
  64. 64. Take note of this Said the young developer Your code… Is bogus.
  65. 65. Why bother one person… Often takes up the whole team.
  66. 66. I was going to work But a code review says “No” You will do no work.
  67. 67. …when you can bother everyone. Not possible for all the changes.
  68. 68. Sometimes code is long A meeting will last too long Just let it go through?
  69. 69. Ways to do code reviews Over-shoulder code review
  70. 70. I want to review But I cannot see your code. Your hair is too big.
  71. 71. Developer in control
  72. 72. Please ignore that mess If you say nothing Then it’s fine to go to prod.
  73. 73. Stop this review, I want to get off! Reviewer Along for the Ride
  74. 74. You asked me for help Where did the code go poorly? You will not show me.
  75. 75. I hope that’s what you wanted to see Developer leads reviewer through code
  76. 76. What I saw looked good… Not much chance to really review
  77. 77. I saw some good stuff The stuff you let me look at The rest must be fine.
  78. 78. Hey… Hey… HEY! Interrupt the reviewer
  79. 79. Stop this code review I want to get off and look What has changed in here?
  80. 80. We get to do that all again? More than one reviewer
  81. 81. Oh, joy, what fun! And Now I get to do that all Back into the breach.
  82. 82. “I have way too much time” - No one More time lost for developer
  83. 83. As I grow older and wiser I try to avoid wasting time. - Bye. ! - SarcasmSociety
  84. 84. Ways to do code reviews Pull Request Code Review
  85. 85. Not totally “teh suck” One of the better options
  86. 86. Top-bottom diffs are Not as easy to read as Side to side code is.
  87. 87. </poetry>
  88. 88. Why you no take my code? May require a pull-request process
  89. 89. DVCS FTW! Works great with git and mercurial
  90. 90. Sucky Version Numbers Crappy Version System Less so with SVN or CVS
  91. 91. This is my rifle, this is a wrench... Code review tools vary a LOT
  92. 92. Ways to do code reviews What does work?
  93. 93. Use the right tool for the job Formal Code Review With Software
  94. 94. Don’t hammer screws with a saw Specifically Code Review Software
  95. 95. It’s like they made it to do this. Designed for Easy Review of Changes
  96. 96. Do it on your own time. Reviews Don’t Interrupt Development
  97. 97. If only I could write what I thought. Comments on lines /groups of lines
  98. 98. Comment all the things! Comments on overall changes
  99. 99. What are you going to say about it? Allows for replies to comments
  100. 100. What about the code as a whole? Overall Review Status
  101. 101. Stuff that has to be fixed Issues
  102. 102. It’s all good “Ship It”
  103. 103. Did you make the changes? Allows for Updating Diffs
  104. 104. Code based on someone else’s code. Diffs with Parent Diffs
  105. 105. Git, Hg, SVN, etc Allow for Multiple VCS
  106. 106. Why don’t all things have APIs? API to integrate into process
  107. 107. How to Implement Formal Code Review Installation / Hosted
  108. 108. How to Implement Formal Code Review Get buy-in by devs and management
  109. 109. How to Implement Formal Code Review Decide how to integrate into process.
  110. 110. How to Implement Formal Code Review How many reviews?
  111. 111. How to Implement Formal Code Review How many ship its?
  112. 112. How to Implement Formal Code Review Other requirements or restrictions
  113. 113. How to Implement Formal Code Review Timeframe to complete review
  114. 114. How to Implement Formal Code Review Timeframe for responses
  115. 115. Code of Conduct for Reviews No personal attacks
  116. 116. Code of Conduct for Reviews Really. No personal attacks
  117. 117. Code of Conduct for Reviews Constructive criticism
  118. 118. Code of Conduct for Reviews Constructive criticism only.
  119. 119. How to Implement Formal Code Review No long ongoing conversations
  120. 120. How to Implement Formal Code Review Move those to in-person, video, etc
  121. 121. How to Implement Formal Code Review Keep the review about the code
  122. 122. How to Implement Formal Code Review What can be considered “issues”?
  123. 123. Benefits of Formal Code Review
  124. 124. Benefits of Formal Code Review Better Code
  125. 125. Benefits of Formal Code Review Bugs caught before launch or QA testing
  126. 126. Benefits of Formal Code Review Learning Opportunity for All Devs
  127. 127. Benefits of Formal Code Review More eyes leads to better code
  128. 128. Software • • • • • • Review Board Atlassian Crucible Code Collaborator Phabricator Kiln etc
  129. 129. Please rate this talk https://joind.in/10448

×