Chapter 1. Refactoring, a First Example

When I wrote the original edition of Refactoring I had to decide how to open the book. Traditionally technical books start with a general introduction that outlines things like history and broad principles. 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 decided to start the book with an example of refactoring. Several reviewers saw it as an unusual ...

Get Refactoring: Ruby Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.