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.

Develop your sense of code smell

431 views

Published on

It has been 18 years since Martin Fowler published “Refactoring” which codified an initial catalog of code smells. But in that time, have our noses been able to sniff them out? What have we done to develop our sense of smell? We will do a series of Sparrow Decks to increase our sense of code smell by building the pattern recognition part of our brain. This way we can more easily know if there is something wrong with the code. Remember smelling you have a problem is always the first step. (Note: this technique works for non-programmers as well as programmers so even if you’re not a programmer, come and develop your sense of code smell!)

Published in: Software
  • Be the first to comment

  • Be the first to like this

Develop your sense of code smell

  1. 1. Develop your Sense of Code Smell Mike Clement @mdclement Founding Software Craftsman at Greater Sum mike@softwareontheside.com http://blog.softwareontheside.com
  2. 2. Examples of smells in the physical world? Photo by freestocks.org on Unsplash
  3. 3. What if you couldn’t smell?
  4. 4. What if you learned to smell wrong?
  5. 5. What does that even mean?
  6. 6. Style Ira Glass video
  7. 7. Photo by henry fournier on Unsplas
  8. 8. Photo by Elijah Henderson on Unsplash
  9. 9. Practice makes…
  10. 10. Practice makes Permanent
  11. 11. Photo by Roksolana Zasiadko on Unsplash
  12. 12. Practice makes Permanent
  13. 13. High Quality, High Quantity Examples
  14. 14. Sparrow Decks
  15. 15. You have to try…
  16. 16. Yes you’re going to feel silly…
  17. 17. And you might be wrong…
  18. 18. And sometimes you WILL be wrong…
  19. 19. But trying is really important!
  20. 20. Sparrows
  21. 21. Win this book and a mechanical keyboard at the closing!
  22. 22. Code Smells • Long Method • Large Class • Primitive Obsession • Long Parameter List • Data Clumps • Alternative Classes with Different Interfaces • Refused Bequest • Switch Statements • Temporary Field • Divergent Change • Parallel Inheritance Hierarchies • Shotgun Surgery • Comments • Duplicate Code • Data Class • Dead Code • Lazy Class • Speculative Generality • Feature Envy • Inappropriate Intimacy • Incomplete Library Class • Message Chains • Middle Man
  23. 23. Code smell is maybe a misnomer Photo by freestocks.org on Unsplash
  24. 24. How do you get the necessary reps?
  25. 25. You have to try…
  26. 26. Yes you’re going to feel silly…
  27. 27. And you might be wrong…
  28. 28. And sometimes you WILL be wrong…
  29. 29. But trying is really important!
  30. 30. Long Line
  31. 31. Clutter
  32. 32. Photo by Doug Linstedt on Unsplash
  33. 33. Bad Names
  34. 34. You have to try…
  35. 35. Yes you’re going to feel silly…
  36. 36. And you might be wrong…
  37. 37. And sometimes you WILL be wrong…
  38. 38. But trying is really important!
  39. 39. But why Mike?
  40. 40. Why do I have to try?
  41. 41. Why do I have to try? Rat video
  42. 42. Long Method
  43. 43. Duplication
  44. 44. http://bit.ly/sparrowdecks Sparrow Decks
  45. 45. Code Smells • Long Method • Large Class • Primitive Obsession • Long Parameter List • Data Clumps • Alternative Classes with Different Interfaces • Refused Bequest • Switch Statements • Temporary Field • Divergent Change • Parallel Inheritance Hierarchies • Shotgun Surgery • Comments • Duplicate Code • Data Class • Dead Code • Lazy Class • Speculative Generality • Feature Envy • Inappropriate Intimacy • Incomplete Library Class • Message Chains • Middle Man
  46. 46. Resources • Llewellyn Falco’s Sparrow Decks: http://llewellynfalco.blogspot.com/p/sparrow-decks.html • Kathy Sierra on Making Badass Developers: https://www.youtube.com/watch?v=FKTxC9pl-WM • Smell Descriptions online: https://refactoring.guru/refactoring/smells
  47. 47. Mike Clement • @mdclement • mike@softwareontheside.com • https://github.com/mdclement • Slides at: http://blog.softwareontheside.com • Greater Sum • @thegreatersum • http://www.greatersum.com • Software Craftsmanship Atlanta • Find us on meetup.com

×