|
A leaky abstraction is an unsatisfactory implementation of an abstraction. Unsatisfactory means any case when specific implementation details manifest themselves in some obstructive or counter-productive way, thus interfering with the abstraction. The implementation details are said to "leak through" and interfere with the simplifying assumptions supposedly enabled by the abstraction. Look up Implementation in Wiktionary, the free dictionary. ...
Abstraction is the process of reducing the information content of a concept, typically in order to retain only information which is relevant for a particular purpose. ...
Within the software industry, leaky abstractions are a common source of software bugs. The examples and perspective in this article or section may not represent a worldwide view. ...
A software bug is an error, flaw, mistake, failure, or fault in a computer program that prevents it from behaving as intended (e. ...
Overview
The term is widely attributed to software commentator Joel Spolsky, who published the concept as It has been suggested that this article or section be merged with Joel on Software (weblog). ...
The Law of Leaky Abstractions: "All non-trivial abstractions, to some degree, are leaky." In the publication, Spolsky expresses this viewpoint, and supports it with reference to examples in software engineering, which is why this term is customarily used in the context of computer software and hardware. Software Engineering (SE) is the design, development, and documentation of software by applying technologies and practices from computer science, project management, engineering, application domains, interface design, digital asset management and other fields. ...
Technical sense When applying the term to a specific instance, it's a misnomer in that the implementation is leaky, not the abstraction. Abstractions are conceptual and are not susceptible to leaks. Abstractions may have other faults, such as ambiguities or contradictions. The term 'leaky abstraction' refers not to faults in the abstraction itself, only to faults in its implementation. An editor has expressed a concern that the topic of this article may be unencyclopedic. ...
Generalized sense From the perspective of Spolsky's Law of Leaky Abstractions, all non-trivial abstractions resist complete implementation by their very nature. Consequently, implementation details will always leak through, regardless of how well-conceived, and no matter how rigorously they attempt to faithfully represent the abstraction. Sometimes the leaks are minor, other times they are significant, but they will always be present, because there is no such thing as a perfect implementation of an abstraction. In this context, the term isn't a misnomer, since it applies to all implementations of all abstractions. It is most likely this notion Spolsky intended to convey by expressing the viewpoint as a "law" and attributing the "leakiness" to abstractions, rather than to imprecise implementations.
Philosophical sense In an epistemological sense, the human concept of any abstraction is always an implementation of deeper abstractions, represented in mental concepts and verbal statements used to convey them. There is no generally agreed-upon deepest layer of abstraction. Much (if not most) of the field of philosophy is predicated upon searching for such a layer. This article does not cite its references or sources. ...
The idea that all sufficiently interesting abstractions are leaky thus has profound philosophical ramifications. Consider the field of physics. An atom of hydrogen is an abstraction which is implemented, on a deeper level, by a set of quarks. The extent to which the nature of the quarks "leaks" through to the nature of the hydrogen atom appears to depend largely on context such as temperature. However, there's no doubt that the quark implementation leaks through; otherwise, it would not be possible to know about quarks. Humans only know they exist based on the extent to which they leak through higher-level abstractions. Physics (from the Greek, (phúsis), nature and (phusiké), knowledge of nature) is the science concerned with the discovery and understanding of the fundamental laws which govern matter, energy, space, and time. ...
In this way, the Law of Leaky Abstractions is a tautology. Any abstraction that isn't leaky cannot be distinguished from a fundamental truth. A fundamental truth is not properly an abstraction. Ergo, no abstractions are not leaky. Tautology refers to a use of redundant language in speech or writing, or, put simply, saying the same thing twice. Within the study of logic, a tautology is a statement that is true by its own definition. ...
Examples Monetary value Paper currency implements the abstract economic concept of monetary value. Conceptually, monetary value cannot be destroyed; yet a paper dollar can be. The physical nature of the implementation (the paper dollar) corrupts the conceptual nature of the abstraction (its monetary value). If a dollar is burned, the value is lost, even though such a result shouldn't be possible from the perspective of monetary ownership. Economics (deriving from the Greek words Î¿Î¯ÎºÏ [okos], house, and νÎÎ¼Ï [nemo], rules hence household management) is the social science that studies the allocation of scarce resources to satisfy unlimited wants. ...
Computers Computer hardware and software is heavily reliant on abstraction, and therefore subject to the consequences of leaky abstraction. Hardware is the general term that is used to describe physical artifacts of a technology. ...
Computer software (or simply software) refers to one or more computer programs and data held in the storage of a computer for some purpose. ...
For example, many different brands of sound card exist, and each has different capabilities and methods of operation. It is the role of the computer's operating system to implement a sound card abstraction for programs, so that a program need not have knowledge about every possible sound card that may be present. The program tells the operating system's sound card abstraction what sound to make, and the operating system then tells the sound card to make the sound using the mechanisms and capabilities unique to that sound card. If the abstraction isn't leaky, then a program can take advantage of any sound card with no problems. If the abstraction is leaky, however, the program may run into trouble - the sound may come out differently depending on the sound card, requiring the program to compensate by incorporating logic specific to the sound card installed in the computer. A sound card is a computer expansion card that can input and output sound under control of computer programs. ...
A BlueGene supercomputer cabinet. ...
An operating system (OS) is a computer program that manages the hardware and software resources of a computer. ...
Any API which behaves differently depending on the underlying implementation is considered leaky. If a program fails to compensate for leaky APIs, bugs can result. API may refer to: In computing, application programming interface In petroleum industry, American Petroleum Institute In education, Academic Performance Index This page concerning a three-letter acronym or abbreviation is a disambiguation page â a navigational aid which lists other pages that might otherwise share the same title. ...
Obscure error messages are a common observable effect of leaky abstractions in software. A newfangled sound card, for example, may be able to reproduce the same sounds as old sound cards, but it also may have new ways of failing. If the operating system's sound card abstraction didn't anticipate the new failure modes, the program will encounter a failure it couldn't anticipate and can't understand. This can result in an "unknown error" or similar error message being presented to the user. This page is a candidate for speedy deletion. ...
A failure mode is a characterization of the way a product or process fails. ...
External links |