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.
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.
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.
"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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With