3 ms·
> But the moment I have to care about the implementation of an abstraction rather than the abstraction itself, the abstraction has leaked. No, that's not what
by naasking 7y ago
> But the moment I have to care about the implementation of an abstraction rather than the abstraction itself, the abstraction has leaked.
No, that's not what leaky abstraction means. If an abstraction specifies its performance properties, but those properties depend on context that isn't captured by or enforced by the abstraction, that's a leak.
To use your example of the STL, if you can allocate a fast constant-time abstraction at a misaligned address, thus causing it to violate its own performance specification, that's a leaky abstraction.
Having the wrong performance characteristics simply means it's the wrong abstraction, not that the abstraction is leaky.
- AnimalMuppet 7y agoI think you're a bit too narrow in your definition. If an abstraction specifies properties, but I have to care about more than those properties to be able to use the abstraction, then the abstraction leaked. Performance can be one of those things I have to care about.