You are previewing Refactoring: Improving the Design of Existing Code.

Refactoring: Improving the Design of Existing Code

Cover of Refactoring: Improving the Design of Existing Code by Don Roberts... Published by Addison-Wesley Professional
O'Reilly logo

Chapter 1. Refactoring, a First Example

How do I begin to write about refactoring? The traditional way to begin talking about something is to outline the history, broad principles, and the like. When someone does that at a conference, I get slightly sleepy. My mind starts wandering with a low-priority background process that polls the speaker until he or she gives an example. The examples wake me up because it is with examples that I can see what is going on. With principles it is too easy to make generalizations, too hard to figure out how to apply things. An example helps make things clear.

So I’m going to start this book with an example of refactoring. During the process I’ll tell you a lot about how refactoring works and give you a sense ...

The best content for your career. Discover unlimited learning on demand for around $1/day.