Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "level of indirection" mean in David Wheeler's aphorism?

I've read this quote in a book:

There is no problem in computer science that can't be solved using another level of indirection.

Can someone explain that? What does "level of indirection" mean?

From what I understood, indirection is a fancy name for using a pointer of a value instead of the value itself. Please clarify this for me.

like image 984
Andrei Diaconu Avatar asked Aug 01 '13 20:08

Andrei Diaconu


People also ask

What is level of indirection?

In strongly typed interpreted languages with dynamic datatypes, most variable references require a level of indirection: first the type of the variable is checked for safety, and then the pointer to the actual value is dereferenced and acted on.

What is indirection in database?

Indirection allows you to retrieve objects from the database as needed. With indirection turned off, when an object is retrieved from the database all the other objects that it references are also retrieved. With indirection turned on, each object is retrieved from the database only when asked for.


1 Answers

"Indirection" is using something that uses something else, in its broadest sense.

So your example, using a pointer of a value instead of the value, fits this definition at one level. The pointer is the something and the value is the something else.

Typically this is something larger in scope:

  • Using a web site to graphically display the data generated by an XML based service. Here the web site is the something and hiding behind it is the data which is the something else.
  • Using an operating system to access the display screen. Here are two layers, at least of indirection. The OS uses the screen driver. One something using a something else. Then the screen driver talks directly to the screen hardware causing it to make tiny dots of light here and there. The driver is the next something using the something else which is the hardware.
  • It is not uncommon for one API to deal with something on a high level and that API deals with the same thing on a lower level. Again a level of indirection is added on top of the low level API and we call it the new, improved API.

This last example, perhaps, explains the "why" of it all.

As we work with something we master it and learn how to abstract it to a higher level of abstraction, thus a new level of indirection is needed and we can solve bigger problems faster by offloading some of the work to the new API.

like image 128
Lee Meador Avatar answered Oct 02 '22 05:10

Lee Meador