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?

Highlights

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...

Includes

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

Contents

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 Survey 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 Names 30
This or That Survey 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
Useless Comment 41
Comment Guidelines 42
Comment Quiz 43
A Comment Judgment Call 44
Other Deodorants 45
Long Method 47
Long Method Makeover 48
What About Performance? 49
Long Methods and Performance 50
Why Do People Write Long Methods? 51
Long Method Survey 52
Large Class 54
Large Class Quiz 55
Dead Code 57
Removing Dead Code 58
Dead Code Example 59
Dead Code Survey ← Click to Preview 60
Lazy Class 62
How Lazy? 63
Baby Classes 64
Lazy Class Survey 65
Refactoring Common Smells 67
Oddball Solution 69
Oddball Solution Example 70
Majority Or Minority Oddball? 71
Oddball Solution Quiz 72
Primitive Obsession 74
Example: Repetitiveness 75
Example: Awkwardness 76
Primitive Obsession Survey 77
Switch Statement 79
Switch Statement Example 80
Replacing Switch Statements With Polymorphism 81
A False Case of a Switch Statement Smell 82
Maps Instead of Switch Statements 83
Switch Statement Quiz 84
Speculative Generality 86
Speculative Generality Example 87
Speculative Generality Quiz 88
Refactoring More Common Smells 90
Conditional Complexity 95
Conditional Complexity Example 96
Conditional Complexity Solution 97
Conditional Complexity Sprawl 98
Conditional Complexity Quiz 99
Combinatorial Explosion 101
A Combinatorial Explosion of Methods 102
A Combinatorial Explosion of Classes 103
Combinatorial Explosion Quiz 104
Alternative Classes With Different Interfaces ← Click to Preview 106
An Example of Alternative Classes with Different Interfaces 107
Adapting a Class with a Different Interface 108
Inappropriate Intimacy 110
Inappropriate Intimacy Example 1 111
Inappropriate Intimacy Example 2 112
Inappropriate Intimacy Quiz 113
Indecent Exposure 115
Indecent Exposure Example 🎦 116
Indecent Exposure Quiz 117
Refused Bequest 119
Refused Bequest Example 120
Refused Bequest Quiz 121
Black Sheep 123
Black Sheep Method Example 124
Data Class 126
When Are Data Classes Good? 127
Evolving Away From A Data Class 128
Solution Sprawl 130
Solution Sprawl Example 🎦 131
A Solution Sprawl Solution 132
Solution Sprawl Quiz 133
Feature Envy 135
Feature Envy Example ← Click to Preview 136
Feature Envy Between Order & Catalog? 137
Feature Envy Quiz 138
Temporary Field 140
Temporary Field Example 141
Temporary Field Quiz 142
Side Effect 144
When Are Side Effects Ok? 145
Side Effect Example 146
Refactoring More Uncommon Smells Quiz 148
Smellections Introduction 150
The Smellections Scavenger Hunt 151
The Solutions in Depth 152
Smells in Collection 🎦 153
Smells in AbstractList and AbstractSet 🎦 154
Smells in AbstractCollection 🎦 155
Smells in List 🎦 156
Smells in Set 🎦 157
Smells in Map 🎦 ← Click to Preview 158
Smellections Hunt Conclusion 159
Conclusion - What’s Next? 161

Related Items

Supported Browsers

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

Operating Systems

  • Windows
  • Linux
  • Mac OS X

Development Tools

All of our programming exercises come with projects pre-configured for IntelliJ, Eclipse and Visual Studio.

Speakers or headphones are required for our videos.