The book Refactoring 2nd edition by Martin Fowler provides detailed descriptions of refactorings with a motivation for doing them, the mechanics, and an example. It teaches you how to improve the design and quality of code in small steps without changing external behavior.
I interviewed MartinFowler about the major changes in the 2nd edition of Refactoring, how to recognize code smells and refactor code, how code reviews and refactoring support each other, what tech leads can do to encourage refactoring, the benefits refactoring brings, using tools for refactoring, and mob programming.
Read the full interview on InfoQ: Q&A on the Book Refactoring – Second Edition.
15 quotes from Refactoring
Here’s a set of 15 quotes from the book Refactoring. I’m tweeting these quotes with #Refactoring.
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
If your refactoring introduces performance slow-downs, finish refactoring first and do performance tuning afterwards
Before you start refactoring, make sure you have a solid suite of tests. These tests must be self-checking.
If someone says their code was broken for a couple of days while they are refactoring, you can be pretty sure they were not refactoring
Refactoring isn’t an activity that’s separated from programming—any more than you set aside time to write if statements
Code Quality Matters!
Refactoring is a technique used to continuously restructure your code when the architecture or design changes or needs to change. The purpose is to keep it maintainable. Refactoring should not change the external behavior of the product.
Martin Fowler’s 2nd edition of Refactoring defines what refactoring is and provides insights into the practice of refactoring. It also contains a catalog of refactorings which programmers can use to develop their skills. I highly recommend this book!
Debugging is a key skill to find bugs quickly and resolve them. In Effective Debugging, Diomidis Spinellis explains many useful debugging methods, strategies, techniques, and tools.
There are several ways to increase your coding capabilities. The Clean Coder by Bob Martin gives examples of how developers can exercise and sharpen their skills with coding dojos and doing katas. Another recommended reading on this topic is The Software Craftsman by Sandro Mancuso.
Books that I have read and that I like are added to my recommended books. I provide book tips in my workshops and when I work with clients. This is one of the ways in which I share my experience.