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!)
1. Develop your Sense of
Code Smell
Mike Clement
@mdclement
Founding Software Craftsman at Greater Sum
mike@softwareontheside.com
http://blog.softwareontheside.com
2. Examples of smells in the physical world?
Photo by freestocks.org on Unsplash
24. Win this book and a mechanical keyboard at the closing!
25. 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
26. Code smell is maybe a misnomer
Photo by freestocks.org on Unsplash
49. 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
50. 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
51. 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