This is a quote attributed to David Wheeler, an early computer scientist who also invented subroutines among other things. Indirection refers to operating on a higher level of abstraction by implementing indirection such as dynamic dispatch or creating object hierarchies in object oriented programming. However, too many layers of indirection can also cause duplication of lower level code so this popular adage is sometimes suffixed with “except the problem of too many layers off indirection”.
Links to this note
Getting logging to work using FastAPI in a production ECS environment is a mess of configuration and awkward interfaces. For example, there are multiple modules that interact in subtle ways: the python
gunicorn. Take a look at this example of the ceremony required to appease all three loggers depending on the run time—not quite the spirit of python ‘explicit over implicit’.
It’s better to favor duplication over the wrong abstraction. The wrong abstraction starts out as a way to remove duplication and then gets altered over time to handle more and more conditions to the point where it’s unique to all the callers.
Fetching API data from a component using React requires handling loading, error, auth, and success states. This makes fetching data difficult to abstract and integrate well into the hooks in a natural way. Further, it’s easy to make mistakes calling function components with the wrong props only to find out at run time.