By Joshua Kerievsky

How do you distinguish great software design from poor software design? Code Smells go beyond vague programming principles by capturing industry wisdom about how not to design code. If you'd like to become skilled at Refactoring, you need to develop your ability to identify Code Smells. Study a collection of important Code Smells and compare each one to a simpler, cleaner design.

Get this Album

Volume Licensing

Have Any Questions?


Hazardous Designs: Produce safer code by understanding a catalog of hazardous software designs. Learn more...
Integrated Forums: Ask questions, get expert replies and read fascinating discussions. Learn more...

Expert Videos: Learn tools & techniques by watching short videos from industry experts. Learn more...


  • 4-6 hours of content
  • 160 pages
  • 22 Code Smells
  • 28 Quizzes
  • 10 Videos
  • Dozens of real-world examples
  • Finding smells in legacy code


You Are Here 3
Welcome To Code Smells 4
Connoisseurs of Code ← Click to Preview 5
How Sensitive Is Your Nose? 6
Introduction To Code Smells 7
What Are Code Smells? 8
A Short History Of Code Smells 9
Technical Debt 11
Credit Card Debt 12
Is Your Code In Debt? 13
What Does Technical Debt Look Like? ← Click to Preview 14
Decreasing Customer Responsiveness 15
Technical Debt At Two Organizations 16
Managing Technical Debt, A Short Quiz 17
Big Picture Cost of Technical Debt 18
Lost Intent 20
Lost Intent Example 21
Intention-Revealing Code 22
Losing Your Intention Quiz 23
Inefficient Name 25
Optimizing Program(mer) Performance 26
The Goal: Reveal Intention ← Click to Preview 27
Perfect: Simple, Consistent, Accurate 28
Typing Is Not The Bottleneck 29
Fixing Inefficient Name 30
This Or That Quiz 31
Duplicated Code 33
Blatant Duplication 34
Subtle Duplication 35
Don’t Repeat Yourself 36
Duplicated Code Quiz 37
When is it Okay to Copy Code? 38
Deodorant Comment ← Click to Preview 40
Comment Guidelines 41
Comment Quiz 42
A Comment Judgment Call 43
Other Deodorants 44
Long Method 46
Long Method Makeover 47
What About Performance? 48
Long Methods and Performance 49
Why Do People Write Long Methods? 50
Long Method Quiz 51
Large Class 53
Large Class Quiz 54
Dead Code 56
Removing Dead Code 57
Dead Code Example 58
Dead Code Quiz ← Click to Preview 59
Lazy Class 61
How Lazy? 62
Baby Classes 63
Lazy Class Quiz 64
Refactoring Common Smells 66
Oddball Solution 68
Oddball Solution Example 69
Majority Or Minority Oddball? 70
Oddball Solution Quiz 71
Primitive Obsession 73
Primitive Obsession Example: Repetitiveness 74
Primitive Obsession Example: Awkwardness 75
Primitive Obsession Survey 76
Switch Statement 78
Switch Statement Example 79
Replacing Switch Statements With Polymorphism 80
A False Case Of A Switch Statement Smell 81
Maps Instead of Switch Statements 82
Switch Statement Quiz 83
Speculative Generality 85
Speculative Generality Example 86
Speculative Generality Quiz 87
Refactoring More Common Smells 89
Conditional Complexity 94
Conditional Complexity Example 95
Conditional Complexity Solution 96
Conditional Complexity Sprawl 97
Conditional Complexity Quiz 98
Combinatorial Explosion 100
A Combinatorial Explosion of Methods 101
A Combinatorial Explosion of Classes 102
Combinatorial Explosion Quiz 103
Alternative Classes With Different Interfaces ← Click to Preview 105
An Example Of Alternative Classes With Different Interfaces 106
Adapting A Class With A Different Interface 107
Inappropriate Intimacy 109
Inappropriate Intimacy Example 1 110
Inappropriate Intimacy Example 2 111
Inappropriate Intimacy Quiz 112
Indecent Exposure 114
Indecent Exposure Example 115
Indecent Exposure Quiz 116
Refused Bequest 118
Refused Bequest Example 119
Refused Bequest Quiz 120
Black Sheep 122
Black Sheep Method Example 123
Data Class 125
When Are Data Classes Good? 126
Evolving Away From A Data Class 127
Solution Sprawl 129
Solution Sprawl Example 130
A Solution Sprawl Solution 131
Solution Sprawl Quiz 132
Feature Envy 134
Feature Envy Example ← Click to Preview 135
Feature Envy Between Order & Catalog? 136
Feature Envy Quiz 137
Temporary Field 139
Temporary Field Example 140
Temporary Field Quiz 141
Side Effect 143
When Are Side Effects Ok? 144
Side Effect Example 145
Refactoring More Uncommon Smells Quiz 147
Smellections Introduction 149
The Smellections Scavenger Hunt 150
The Solutions in Depth 151
Smells In Collection 152
Smells In AbstractList and AbstractSet 153
Smells In AbstractCollection 154
Smells In List 155
Smells In Set 156
Smells In Map ← Click to Preview 157
Smellections Hunt Conclusion 158
Conclusion - What's Next? 160

Related Items

Supported Browsers

  • Latest Firefox
  • Internet Explorer 8+
  • Latest Chrome
  • Latest Safari

Operating Systems

  • Windows
  • Linux
  • Mac OS X

Development Tools

You can use whatever developments tools you prefer. If you do use an IDE (Integrated Development Environment), many (though not all) of our labs come with projects pre-configured for Eclipse, IntelliJ and Visual Studio.

Speakers or headphones are required for our videos.

Flash is required to view charts or watch videos — download for free.