Book notes – Refactoring: Improving the Design of Existing Code – Chapter 2

Refactoring helps you develop code more quickly

Refactoring is something you do all the time in little bursts. You don’t decide to refactor, you refactor because you want to do something else, and refactoring helps you do that other thing.

The Rule of Three
The third time you do something similar, your refactor

Refactor when you add a function/feature
Whenever I have to think to understand what the code is doing, I ask myself if I can refactor the code to make that understanding more immediately apparent.

Thoughts
Overall:
A nice read to enforce your conviction to use Refactoring

Refactoring Design
In Chapter 2 Refactoring seems to be presented as a solution to thinking the upfront “best design”, kind of like if it was the perfect detergent for a stain.

What I think the use of Refactoring is kind of a natural evolution of a developer. As beginners we stress out on our first architecture /design, then you evolve a bit and consider that sometimes it is easier to just begin developing instead of sitting for weeks in front of blank paper, yes you might get stuck with the crappy first design on this project. But on the next step you will be almost Refactoring without doing a conscious exercise.
And then learn techniques to refactor

Leave a Reply

Your email address will not be published. Required fields are marked *