What does the quote "Level of Indirection solves every Problem" mean in Computer Science?
"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.
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.
In computer programming, indirection (also called dereferencing) is the ability to reference something using a name, reference, or container instead of the value itself. The most common form of indirection is the act of manipulating a value through its memory address.
Indirection is one of the most useful (and simple) techniques in a software engineer's arsenal. It is a powerful technique for decoupling software units by introducing a layer between two existing units/layers, enabling the introduction of new behaviour, without directly impairing the existing units.
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".
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