4 ms·
Indirection [0] is a quite big topic and applying it can result in both significantly improving the code and getting more problems than benefits. Therefore, the
by asavinov 7y ago
Indirection [0] is a quite big topic and applying it can result in both significantly improving the code and getting more problems than benefits. Therefore, the question is when indirection is appropriate. One opinion [1] is that
"We can solve any problem by introducing an extra level of indirection"
Another opinion is expressed in this post (avoid indirection). In the context of this example, indirection is related to the problem of modularization and separation of concerns. In particular, a typical question is whether we want to hide some details or use the functionality directly.
[0] https://en.wikipedia.org/wiki/Indirection https://en.wikipedia.org/wiki/Indirection
[1] https://en.wikipedia.org/wiki/Fundamental_theorem_of_software_engineering https://en.wikipedia.org/wiki/Fundamental_theorem_of_softwar...
- microtherion 7y agoI always liked the second part of this quote: "…except for the problem of too many levels of indirection"