Develop your Sense of
Code Smell
Mike Clement
@mdclement
Founding Software Craftsman at Greater Sum
mike@softwareontheside.com
http://blog.softwareontheside.com
Examples of smells in the physical world?
Photo by freestocks.org on Unsplash
What if you couldn’t smell?
What if you learned to smell
wrong?
What does that even mean?
Style
Ira Glass video
Photo by henry fournier on Unsplas
Photo by Elijah Henderson on Unsplash
Practice makes…
Practice makes Permanent
Photo by Roksolana Zasiadko on Unsplash
Practice makes Permanent
High Quality, High Quantity Examples
Sparrow Decks
You have to try…
Yes you’re going to feel silly…
And you might be wrong…
And sometimes you WILL be
wrong…
But trying is really important!
Sparrows
Win this book and a mechanical keyboard at the closing!
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
Code smell is maybe a misnomer
Photo by freestocks.org on Unsplash
How do you get the necessary reps?
You have to try…
Yes you’re going to feel silly…
And you might be wrong…
And sometimes you WILL be
wrong…
But trying is really important!
Long Line
Clutter
Photo by Doug Linstedt on Unsplash
Bad Names
You have to try…
Yes you’re going to feel silly…
And you might be wrong…
And sometimes you WILL be
wrong…
But trying is really important!
But why Mike?
Why do I have to try?
Why do I have to try?
Rat video
Long Method
Duplication
http://bit.ly/sparrowdecks
Sparrow Decks
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
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
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

Develop your sense of code smell