Our systems are useful because of the functionality they provide. The functionality comes from code, so it is easy to think that code is implicitly valuable—but this is not the case. Code is a liability. It is a necessary evil that we have to live with to get the functionality we need.
Another reason we tend to feel that code is valuable is that it is expensive to produce. Writing code requires skilled workers to spend lots of time (and consume lots of caffeine). Attributing value to something because we have spent time or effort on it is called the sunk-cost fallacy. Value never comes from investment alone but from the outcome of the investment. This is crucial to understand when working with code since we have to continually put effort into maintaining the code regardless of whether it is valuable.
Every programmer has become bored with a manual task and thought, “I can automate this.” In many cases, this is why we became programmers. However, it is easy to get so distracted by the automation code that it steals focus from the original problem, and we end up spending more time automating the problem than it would have taken to solve it manually.