Comparison
AbstractionvsLevel of abstraction
Abstraction
you stopped caring which of the three implementations you had, and the code got shorter in every caller.
A name for a capability that hides which particular thing provides it, so callers depend on the promise rather than the machinery. The word is used loosely for both the act — pulling a common shape out of two similar things — and the artefact, the interface or type that results. The cost is that every abstraction is a bet that the two things really are the same, and the ones that turn out wrong are more expensive to undo than the duplication they replaced.
Full entry →Level of abstraction
the function reads like a sentence for three lines and then drops into byte offsets.
How far a piece of code sits from the machine, and whether the pieces sitting next to each other sit at the same distance. Code that mixes levels is hard to read because every few lines the reader has to change what kind of thing they are thinking about. The same idea governs conversations: a design review where one person is discussing team ownership and another is discussing connection pools is not a disagreement, it is an altitude mismatch.
Full entry →