Level of Indirection solves every Problem

What does the quote "Level of Indirection solves every Problem" mean in Computer Science?


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:

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:

enter image description here

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.