Leaky abstraction explained

In software development, a leaky abstraction is an abstraction that leaks details that it is supposed to abstract away.[1]

As coined by Joel Spolsky, the Law of Leaky Abstractions states: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.

History

The term "leaky abstraction" was popularized in 2002 by Joel Spolsky.[2] [3] A 1992 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.[4]

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:

In 2020, Massachusetts Institute of Technology computing science teaching staff Anish, Jose, and Jon argued that the command line interface for git is a leaky abstraction, in which the underlying "beautiful design" of the git data model needs to be understood for effective usage of git.[5]

See also

Notes and References

  1. Book: Seibel, Peter . Practical Common Lisp. 1 November 2006. Apress. 978-1-4302-0017-8. 96.
  2. Web site: Spolsky. Joel. The Law of Leaky Abstractions. 2002. 2010-09-22.
  3. Web site: arvindpdmn. 2019-08-23. Leaky Abstractions. 2020-07-07. Devopedia. en-gb.
  4. Web site: Kiczales. Gregor. Towards a New Model of Abstraction in the Engineering of Software. 1992. 2010-02-03. https://web.archive.org/web/20110604013045/http://www2.parc.com/csl/groups/sda/publications/papers/Kiczales-IMSA92/for-web.pdf. 2011-06-04. dead.
  5. Web site: Version Control (Git). 2020-07-31. the missing semester of your cs education. en.