A short summary of the changes between the first and second editions of Refactoring

At the broadest level, the second edition's structure follows that of the first edition. That shouldn't be too surprising, since the first edition was so successful, I might as well continue with what worked.

The first edition opened with four narrative chapters, these all appear the second edition too. All of these follow the broad forms of the original book.

The opening example shifts its domain, as not that many people are familiar with a video store any more. The flow of the refactorings is pretty much the same: break into functions, separate calculation from formatting, organize calculations by type using polymorphism.

The principles and smells chapter both had a thorough overhaul. There's much that survived and much that changed. I'm guessing about three-quarters of it changed, but that's a gut feel rather than based on a realistic measurement. The testing chapter had to be completely redone, particularly due to change from Java to JavaScript.

After those introductory chapters, I continue with the catalog, which I've always seen as the heart of the book. I'll go into the catalog changes in more detail in a moment, but one notable structural change is I put together an initial chapter of refactorings that contains what I judge to be a good set of refactorings to learn about first.

I dropped the later chapters, which explored some more tangential issues. I think they worked in the first edition, but these days I think it's better to publish essays like this on my website. That's the same reason why I also dropped the four "big refactorings" from the catalog. The big refactorings were always a bit different to the majority of the refactorings, and I do feel these examples work better through essays on my website.