Level of Indirection solves every Problem
Solution 1
Generally it means that by increasing the level of abstraction one can make the problem easier to understand/resolve.
Be careful with your abstractions though, the full quote at least as I heard it is, "You can solve every problem with another level of indirection, except for the problem of too many levels of indirection".
Solution 2
From the book Beautiful Code:
All problems in computer science can be solved by another level of indirection," is a famous quote attributed to Butler Lampson, the scientist who in 1972 envisioned the modern personal computer.
Although this is contradicted by Wikipedia who attributes the phrase to David Wheeler.
Solution 3
Kevlin Henney's corollary is, "...except for the problem of too many layers of indirection".
Solution 4
It basically means that you should break your problem into smaller problems until the problems are easy to solve.
You break the problem into several layers :
- routines that solve the problem
- They call : routines that understand the problem space
- They call : routines that do small steps (load a file, twiddle some bits, write an output).
The routines at the top (the problem solving ones) are indirected / abstracted from the actual means of solving the problem, making them more flexible to solve the same problem a slightly different way later.
Solution 5
Such a very important concept and so few answers here. Generally every problem presented can be solved not necessarily by direct code adjustments but applying some proxy (forget the pattern definition) in some form. The interception &| instrumentation of events is highly undervalued.
Related videos on Youtube
Vicky
Updated on July 14, 2021Comments
-
Vicky about 2 yearsWhat does the quote "Level of Indirection solves every Problem" mean in Computer Science?
-
Onorio Catenacci over 14 yearsThis sounds like a homework assignment. -
TT_ stands with Russia over 2 yearsStill, it is a legitimate question.
-
-
Tjkoopa over 14 yearsGood advice. I routinely work with highly abstract problems and like to describe abstraction as a big lever where you push on the small end: small changes result in large motions, but at the expense that you must push really hard. -
jw013 over 11 yearsAt the end of the chapter, the book mentions that Lampson attributes the quote to David Wheeler, so Wikipedia isn't really contradicting it, just following the indirection, if you will :), to the source. -
user712092 about 11 yearsPlease, what do You mean by interception and/or instrumentation of events? What events? And how is it undervalued? Thanks. -
Brian White almost 9 yearsI heard it with the corollary before I heard it by itself. I bump into this corollary more often than I bump into the situation where i need to add layers of indirection. -
Sridhar Sarnobat almost 7 yearsI'm not sure "making the problem easier to understand" is the right interpretation. -
dreftymac over 6 yearsExcellent answer. -
Hải Phạm Lê over 2 yearsI think it is important to remember that this is notlevel of abstraction, this islevel of indirection. They do not encourage toabstractentities, but to insert one extra step in the flow. Like fetching a pointer's value, we do not abstract raw memory to typed variable, but we require users to access the typed objects first (to implement the need extra logic, like validation), then from there, we let users to access the raw memory. -
Clifford over 2 yearsabstraction is not indirection, Butler Lampson is often misquoted in this way. The accurate quote is " "All problems in computer science can be solved by another level of indirection" (Butler Lampson) - it is an aphorism not intended to be taken precisely literally as a provable theorem. -
Clifford over 2 yearsThat is abstraction not indirection.