Sobes.tech
Middle+

What is a Leaky Abstraction?

sobes.tech AI

Answer from AI

Leaky Abstraction is a situation where an abstraction, intended to hide the complexity of implementation, "leaks," meaning that internal implementation details become visible or influence the use of the abstraction.

In other words, the abstraction does not fully isolate the user from low-level details, and these details must be considered when working with it.

An example from C#:

Suppose you have a class that abstracts network operations, but in certain error situations, you need to know about protocol specifics or network exceptions to handle the situation correctly. This means the abstraction "leaks" — you are forced to consider details that should have been hidden.

Leaky Abstraction is a normal phenomenon in development, and understanding it helps create more robust and understandable systems, recognizing that perfect abstractions do not exist.

What is a Leaky Abstraction? — C# - sobes.tech