6

Book review: Refactoring by Martin Fowler

 2 years ago
source link: https://blog.jakubholy.net/2010/11/25/book-review-refactoring-by-martin-fowler/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Book review: Refactoring by Martin Fowler

November 25, 2010
I had high expectations for Martin Fowler's Refactoring (1999/2002) but it turned out that both me and the book are too old. It had some interesting parts, but the main one - the refactoring catalog itself - had little new for me because I already know most of the refactorings and the description of steps how to perform them safely is nowadays essentially useless as they're already automatically and safely performed by our IDEs.

I've enjoyed chapter 1 with a nice example of how bad code is turned into a nice one via a series of refactorings and I'd recommend it to any beginning developer. For others than me also chapter 2 may be useful, it explains why and when to refactor, how it impacts your development speed and how to justify it to the manager. I'd skip chapter 3 - bad smells in the code - and read instead of it the Uncle Bob's lovely Clean Code , which is a great justification and basis for refactoring anyway.

In the catalog I've appreciated the description of some refactorings for various reasons, such as 6.4 Replace Temp with Query, 8.14 Replace Type Code with Subclasses, 9.7 Introduce Null Object, 9.8 Introduce Assertion. Of course also the other ones are good but they are just too familiar to me and my IDE to draw my attention anymore.

Chapter 12, Big Refactorings, is quite interesting, especially Tease Apart Inheritance.

Finally there are some good advices in Putting It All Together by Kent Beck, such as that it's good to know when to stop and to be able to resist the temptation to refactor too much at once.

I've also appreciated the "war stories", especially regarding performance tuning, where once again it's demonstrated that a guess (however founded) is incomparable to hard evidence.

Conclusion

If you do refactorings daily, perhaps skip the book. If not, read chapter 1, perhaps browse through 2 and 12, check whether anything catches your eye in the refactoring catalog table of content, read Kent's closing chapter and return the book to the local museum.

Are you benefitting from my writing? Consider buying me a coffee or supporting my work via GitHub Sponsors. Thank you! You can also book me for a mentoring / pair-programming session via Codementor or (cheaper) email.

Allow me to write to you!

Let's get in touch! I will occasionally send you a short email with a few links to interesting stuff I found and with summaries of my new blog posts. Max 1-2 emails per month. I read and answer to all replies.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK