
Reading Legacy Code Without Losing Your Mind
Legacy code is code without understanding. Three cheap mapping techniques change that: dependency maps, characterization tests, and strangler fig seams.
For engineers who refuse to stop thinking in the AI era. Because 'it compiles' isn't the same as 'it works'.
Live Last read · last published · next check

Legacy code is code without understanding. Three cheap mapping techniques change that: dependency maps, characterization tests, and strangler fig seams.

A case study about a real registration method that grew to 19 parameters and how we made it maintainable using the Pipes and Filters and Strangler Fig patterns.

Frontend testability is a property of the design, not the framework. Pull the business rule out of the component and 'hard to test' stops being true.

Coverage counts the lines that ran, not the lines verified. A method can reach 100% with its rules unverified. Mutation testing measures the gap.

Most refactoring never needed a sprint or a backlog item. It fits inside the feature branch we already have open, as long as the commits stay separate.

Your team lead isn't against quality. His "no" to refactoring is due to delivery pressure and risk, not indifference, and here's how to argue in his terms.

"Just ship it" isn't wrong, it's unpriced. The post is about what shipping without design actually costs, in three numbers a manager already tracks.

Tech debt is two opposite things sharing one name: an intentional shortcut we chose, and an accidental mess nobody intended.

A service class isn't big because the domain is hard, but because the behavior never went home. A domain name holds the line that the Service suffix never could.

A feature flag that branches on a string is a type code in disguise. Replace it with polymorphic dispatch, and the generated wiring makes a flag safe to delete.

A transfer between two accounts fits in neither. The DDD move: promote the verb to an aggregate, then let event sourcing calculate the balances.