Martin Fowler

Refactoring

Martin Fowler on improving the design of existing code in small, safe steps, each one checked by tests.

The argument. Refactoring means changing the structure of code without changing what it does, in steps small enough that each one is safe and each one is checked by tests. Fowler presents it as the way a design improves continuously, instead of through risky rewrites. The second edition uses JavaScript for its examples and organises a catalogue of named moves you can apply by name.

Ideas worth keeping

Where it shows in Classroom Manager

Large windows in Classroom Manager were split into smaller parts one slice at a time, each slice in its own commit and checked by the test suite before the next. The rule of one change per commit is Fowler’s two hats.

Who should read it

Developers who inherit code they did not write, and anyone who asks how to keep a product healthy for years instead of rewriting it.

Find the book (Open Library) ↗ (opens in a new tab)

Notice: the title, the author's name and any related marks, names and trade dress of the book discussed on this page are the property of their respective owners and are referred to for the purposes of identification, criticism and review only. Dausuva is not affiliated with, sponsored by or endorsed by the author or the publisher. The summary above is original text written by Dausuva, does not reproduce the book, and does not replace it. All rights in the book are reserved by their respective owners.