What does the quote "Level of Indirection solves every Problem" mean in Computer Science?
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".
level of abstraction
, this is level of indirection
. They do not encourage to abstract
entities, 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. –
Paragrapher 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.
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.
First we must understand what Adding Level of Indirection means.
Usually, Adding Level of Indirection means that we are able to provide an alternate way to solve a problem, ideally with some additional benefits. Other times, when nothing is currently working the indirection could be our only solution.
For example if the business need is, "We need to decide what size IP block to procure in order to provide IP addressing to all our sites."
The problem is that if we choose a block that is too small then we will need to get a bigger one. Not only must our administrator go get another block but the now an additional prefixes must be injected in our routing table to access my sites. That's extra time, cost and complexity. Is there a better way?
Today, an IP address means who you are when you login and where you are located.
LISP uses a level of indirection to solve the routing problem stated above.
It does so with some cost:
A new LISP capable server must now exist to map addresses to sites
Two namespaces are required (one for Location the other for ID)
And some additional benefits:
Eliminate the site renumbering when adding a new block
Reduction in size of routing tables
ISP can make changes (moving sites from one host to another)
Conserves IPV4 address space (locator address space not assigned to hosts)
With LISP an ISP can allocate fewer addresses per site
The image below shows the new layer of indirection:
LISP solves the problem by adding a new layer of indirection and simplifies some things, but is not altogether simpler. It's different and in many ways better.
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.
This quote is very broad in its implication. The key to understanding is to focus on the word 'problem'. Problem can be a programming issue/bug, translating a world entity to its equivalent computing component, cost associating with computing solution. Lets say you're trying to solve the issue with cost of developing something yourself, you may want to consider another experts to do the work for you much cheaper in time and money. This is another use of indirection
It originates from Bulter Lampson:
"All problems in computer science can be solved by another level of indirection"
It is clearly an aphorism and not intended to be taken literally. It is certainly not a provable theorem.
© 2022 - 2024 — McMap. All rights reserved.