Hi, my name is Alexander Shvets, I'm the creator of this website. After two years of work, I'm happy to present to you my course on refactoring, which will make you a better programmer.
I have been programming since I was 13. Windows didn't even have a Start button back then. Since that time, I have worked at five companies, learned a half a dozen programming languages and launched several successful projects.
In this course, I will share my knowledge with you and teach you to:
- See the difference between beautiful and ugly code.
- Improve ugly code, even where you thought it was impossible.
- Change the code in such a way that it doesn't break other parts of your program.
You will love the course if you have ever felt like this cat here (https://refactoring.guru/images/content-public/refactoring-cat.mp4) sitting in front of a broken build.
Author(s): Alexander Shvets
Year: 2019
Language: English
Pages: 336
BookmarkTitle:......Page 2
Copyright......Page 3
Preface......Page 5
Code Smells......Page 6
Bloaters......Page 7
Long Method......Page 9
Large Class......Page 13
Primitive Obsession......Page 16
Long Parameter List......Page 20
Data Clumps......Page 23
Object-Orientation Abusers......Page 26
Switch Statements......Page 27
Temporary Field......Page 30
Refused Bequest......Page 33
Alternative Classes with Different Interfaces......Page 36
Change Preventers......Page 39
Divergent Change......Page 40
Shotgun Surgery......Page 43
Parallel Inheritance Hierarchies......Page 46
Dispensables......Page 49
Comments......Page 51
Duplicate Code......Page 54
Lazy Class......Page 59
Data Class......Page 61
Dead Code......Page 64
Speculative Generality......Page 66
Couplers......Page 69
Feature Envy......Page 70
Inappropriate Intimacy......Page 73
Message Chains......Page 76
Middle Man......Page 79
Other Smells......Page 81
Incomplete Library Class......Page 82
Refactoring Techniques......Page 84
Composing Methods......Page 85
Extract Method......Page 88
Inline Method......Page 92
Extract Variable......Page 95
Inline Temp......Page 99
Replace Temp with Query......Page 101
Split Temporary Variable......Page 105
Remove Assignments to Parameters......Page 108
Replace Method with Method Object......Page 111
Substitute Algorithm......Page 115
Moving Features between Objects......Page 118
Move Method......Page 121
Move Field......Page 125
Extract Class......Page 128
Inline Class......Page 132
Hide Delegate......Page 135
Remove Middle Man......Page 139
Introduce Foreign Method......Page 142
Introduce Local Extension......Page 146
Organizing Data......Page 150
Self Encapsulate Field......Page 154
Replace Data Value with Object......Page 158
Change Value to Reference......Page 162
Change Reference to Value......Page 165
Replace Array with Object......Page 168
Duplicate Observed Data......Page 171
Change Unidirectional Association to Bidirectional......Page 176
Change Bidirectional Association to Unidirectional......Page 179
Replace Magic Number with Symbolic Constant......Page 183
Encapsulate Field......Page 187
Encapsulate Collection......Page 191
Replace Type Code with Class......Page 195
Replace Type Code with Subclasses......Page 200
Replace Type Code with State/Strategy......Page 205
Replace Subclass with Fields......Page 210
Simplifying Conditional Expressions......Page 214
Decompose Conditional......Page 217
Consolidate Conditional Expression......Page 220
Consolidate Duplicate Conditional Fragments......Page 223
Remove Control Flag......Page 226
Replace Nested Conditional with Guard Clauses......Page 228
Replace Conditional with Polymorphism......Page 232
Introduce Null Object......Page 237
Introduce Assertion......Page 241
Simplifying Method Calls......Page 244
Rename Method......Page 247
Add Parameter......Page 250
Remove Parameter......Page 253
Separate Query from Modifier......Page 256
Parameterize Method......Page 259
Replace Parameter with Explicit Methods......Page 262
Preserve Whole Object......Page 265
Replace Parameter with Method Call......Page 268
Introduce Parameter Object......Page 271
Remove Setting Method......Page 274
Hide Method......Page 276
Replace Constructor with Factory Method......Page 279
Replace Error Code with Exception......Page 283
Replace Exception with Test......Page 286
Dealing with Generalization......Page 289
Pull Up Field......Page 292
Pull Up Method......Page 295
Pull Up Constructor Body......Page 299
Push Down Method......Page 302
Push Down Field......Page 306
Extract Subclass......Page 309
Extract Superclass......Page 314
Extract Interface......Page 317
Collapse Hierarchy......Page 321
Form Template Method......Page 324
Replace Inheritance with Delegation......Page 328
Replace Delegation with Inheritance......Page 332
Afterword......Page 336