April 18, 2020

Second-Order Refactoring: Narrow The Question

Another small second-order refactoring for you today. I call it “narrow the question”. If you’re asking an object for data, ask for exactly what you want to know, instead of what you’d need to compute what you want to know. A very simple example: the PlayerView wants to disable/enable some of its controls when the […]

Second-Order Refactoring: Narrow The Question Read More »

Second-Order Refactoring: Swap Supplier and Supply

As a hardcore user of TDD and refactoring, there are a number of what I think of as “second tier” refactorings that I use quite frequently. In one’s first intro to refactoring, one sees a lot of "rename", "re-order", "inline", and "extract". These are pretty potent tools, don’t get me wrong, but I think of

Second-Order Refactoring: Swap Supplier and Supply Read More »

Scroll to Top