Level of Indirection solves every Problem

17,881

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.

Share:
17,881

Related videos on Youtube

Vicky
Author by

Vicky

Updated on July 14, 2021

Comments

  • Vicky
    Vicky about 2 years

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

    • Onorio Catenacci
      Onorio Catenacci over 14 years
      This sounds like a homework assignment.
    • TT_ stands with Russia
      TT_ stands with Russia over 2 years
      Still, it is a legitimate question.
  • Tjkoopa
    Tjkoopa over 14 years
    Good 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
    jw013 over 11 years
    At 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
    user712092 about 11 years
    Please, what do You mean by interception and/or instrumentation of events? What events? And how is it undervalued? Thanks.
  • Brian White
    Brian White almost 9 years
    I 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
    Sridhar Sarnobat almost 7 years
    I'm not sure "making the problem easier to understand" is the right interpretation.
  • dreftymac
    dreftymac over 6 years
    Excellent answer.
  • Hải Phạm Lê
    Hải Phạm Lê over 2 years
    I think it is important to remember that this is not 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.
  • Clifford
    Clifford over 2 years
    abstraction 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
    Clifford over 2 years
    That is abstraction not indirection.

Related