Comparison
Deep modulevsLeaky abstraction
Deep module
the interface is three methods and the implementation is two thousand lines, and that ratio is the point.
Ousterhout's framing that a good module has a small interface relative to the functionality behind it, and a bad one — a shallow module — has an interface nearly as complicated as what it hides. It is the sharpest available argument against reflexively splitting classes: many small classes each with a wide interface is more total complexity, not less. It also explains why a pass-through method or a one-line wrapper class feels wrong even when it satisfies every principle on a checklist.
Full entry →Leaky abstraction
the ORM hid the SQL right up until you had to read the query plan to fix a timeout.
An abstraction that mostly hides the thing underneath, until the thing underneath misbehaves and you have to understand both. All non-trivial abstractions leak; the useful question is where and how loudly. It matters when choosing a tool because a leaky abstraction does not save you from learning what is beneath it, it only delays the learning to the worst possible moment, which is an incident.
Full entry →