Refactoring: Improving the Design of Existing Code

by Martin Fowler

With this classic software development book, Martin Fowler introduced in 1999 the topic of "refactoring", which was already known in the SmallTalk community then, to a broad developer community.

The book first describes the basic principles of refactoring and illustrates them with an introductory example.

The motivation for refactoring is usually a "code smell", i.e., code that works but is difficult to read and maintain. By naming and describing widely used code smells, Fowler also brought them to the attention of the developer community.

The largest part of the book comprises the catalog of over 60 refactorings. For each refactoring, the author describes the motivation (i.e., the situation in which it is to be applied), explains the functionality step-by-step, and demonstrates it vividly using JavaScript code examples.

This is where the changes in the second edition become clear: Fowler has not merely superficially polished the book but has extensively updated the entire catalog. Thus, he has renamed, consolidated, added refactorings, and replaced the Java examples with JavaScript variants. He provides appropriate notes where differences arise from using weakly vs. strongly typed programming languages.

Refactoring is not light reading (I had to keep pausing at the advanced refactorings) – yet I consider it a timeless must-read for all software developers.

For beginners, it is an excellent introduction to the subject. And professionals, for whom refactoring has been part of the TDD cycle for years and who know every refactoring shortcut in their IDE by heart, will learn a new refactoring or two – or find that refactorings they've done intuitively also have a name and a formal process.

🎧 Suitable as an audiobook: No, and fortunately, it is not available as such.

Other Recommendations From This Books’s Genres

* Disclosure: We love sharing our favorite books with you! As an Amazon Associate, we earn a small commission from purchases you make through our links, which helps us continue creating content you enjoy.