Leaky abstraction

In software development, a leaky abstraction is an abstraction that exposes to its users details and limitations of its underlying implementation that should ideally be hidden away. Leaky abstractions are considered problematic, since the purpose of abstractions is to manage complexity by concealing unnecessary details from the user.

History

The term "leaky abstraction" was popularized in 2002 by Joel Spolsky.[1] An earlier paper by Kiczales describes some of the issues with imperfect abstractions and presents a potential solution to the problem by allowing for the customization of the abstraction itself.[2]

The Law of Leaky Abstractions

As coined by Spolsky, the Law of Leaky Abstractions states:

All non-trivial abstractions, to some degree, are leaky.

This statement highlights a particularly problematic cause of software defects: the reliance of the software developer on an abstraction's infallibility.

Spolsky's article gives examples of an abstraction that works most of the time, but where a detail of the underlying complexity cannot be ignored, thus leaking complexity out of the abstraction back into the software that uses the abstraction.

Effect on software development

As systems become more complex, software developers must rely upon more abstractions. Each abstraction tries to hide complexity, letting a developer write software that "handles" the many variations of modern computing.

However, this law claims that developers of reliable software must learn the abstraction's underlying details anyway.

Examples

Spolsky's article cites many examples of leaky abstractions that create problems for software development:

See also

References

  1. Spolsky, Joel (2002). "The Law of Leaky Abstractions". Retrieved 2010-09-22. - a blog post by Spolsky that asserts that all non-trivial abstractions are 'leaky' and therefore problematic.
  2. Kiczales, Gregor (1992). "Towards a New Model of Abstraction in the Engineering of Software" (PDF). Retrieved 2010-02-03. - a paper by Gregor Kiczales that describes the problem of imperfect abstractions and suggests a programming model for coping with them.
This article is issued from Wikipedia - version of the Monday, October 26, 2015. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.