Refactor before a change

Make the change easy (warning: this might be hard), then make the easy change — Kent Beck

Refactoring is not about archiving the most excellent design patterns density.

Refactoring is about balancing simplicity, readability, and changeability.[¹]

If you need to change your Code, why would you make it in any other way that is not easy to make the change?

Refactor because you need to make a change, not a hypothetical change, an actual change. Read bug fix or new feature.

Do not refactor if you are embarrassed about your Code. Refactoring is not about aesthetics.

Refactor to gather more insight about a problem. But whatever you do, always Refactor.

— -

[¹]: [James Dabbs] (2021): RailsConf 2019 — Refactoring Live: Primitive Obsession by James Dabbs (https://youtube.com/watch?v=LhX5COR8WXc)

--

--

Rafael A. George Duval

✍🏼 Indie writer, chief editor of https://snippetsoftext.substack.com/ | 💻 Software Engineer | 📊 Tech Leadership