Refactoring by Martin Fowler is considered a classic book.
But is the book still relevant?
Simply stated, yes.
This post contains affiliate links. I may receive compensation if you buy something. Read my disclosure for more details.
TLDR Refactoring By Martin Fowler: Improving the Design of Existing Code (2nd Edition)
📚 Originally published in 1999, Refactoring is considered a classic book.
🖥️ The book helps programmers improve the design of existing code and enhance software maintainability.
🔥 Refactoring gets a twist with the 2nd edition. Its best new feature is the coding examples, where Fowler uses JavaScript to illustrate refactoring concepts.
When the first edition of Refactoring: Improving the Design of Existing Code was released, it was a revelation for thousands of programmers.
Designed to help improve the design of existing code and enhance software maintainability, the book included hundreds of pages of instructions, code samples, and insight.
As Fowler notes, nobody had written a book about refactoring until he did.
Refactoring was such a monumental book that years later people were still raving about it:
Refactoring: Improving the Design of Existing Code is one of those amazing books that every professional developer should have on their book shelf.
But the book started losing its edge as the years went by.
For one, the dominant force in code structure was mainly classes back in 1999.
Nowadays we have other structures playing dominant roles.
Number two, some of the code examples were showing their age.
Fowler references java.util.Vector
as a specific example.
So in 2018, Refactoring by Martin Fowler was given a new life.
And this time instead of using modern Java for the code samples, he opted to use modern JavaScript instead.
But Fowler didn’t choose JavaScript because he loves the language.
Rather, he realized JavaScript is both a popular language and one that offers some attractive characteristics.
For example, he references its approachability and a good class model since ES6.
Further, top-level functions make it easier to show refactoring out of the context of classes.
In the words of Fowler himself:
Choosing JavaScript was deeply ironic for me, as many readers may know, I’m not a fan of it. It has too many awkward edge cases and clunky idioms.
What does the book cover?
In Refactoring you will learn:
- The process and principles of refactoring
- How to make your programs easier to understand & change
- How to identify “bad code smells” that signal opportunities to refactor
You will also: - Explore refactorings, all containing explanations, motivation, mechanics & basic examples
- Build tests
- Identify tradeoffs & obstacles to refactoring
Who should read Refactoring by Martin Fowler?
This book is good for advanced beginners, along with intermediate and advanced programmers.
Refactoring by Martin Fowler: Conclusion
This is a classic book that belongs in every programmer’s library. JavaScript was an unconventional language for a textbook-style publication, but wise.
The web continues to eat up large swaths of the software industry.
And the language of the web (JavaScript) will expose itself to most new programmers one way or another.
This is one of the few JavaScript-centric books available that is both academic and practical in nature. Refactoring by Martin Fowler is a must-have book.