O'Reilly logo

Refactoring to Patterns by Joshua Kerievsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Code Smells

When you have learned to look at your words with critical detachment, you will find that rereading a piece five or six times in a row will each time bring to light fresh spots of trouble. [Barzun, 229]

Refactoring, or improving the design of existing code, requires that you know what code needs improvement. Catalogs of refactorings help you gain this knowledge, yet your situation may be different from what you see in a catalog. It’s therefore necessary to learn common design problems so you can recognize them in your own code.

The most common design problems result from code that

•  Is duplicated

•  Is unclear

•  Is complicated

These criteria can certainly help you discover places in code that need improvement. On the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required