A bit ago (around 5 years at this point), a relatively senior manager said something interesting to me, in the context of a software company. I had just started working in a new area, effectively, and this person was a senior director in charge of all software development efforts for that part of the company. He said (and paraphrasing, to be clear): "we want to ensure that we do not have any extra code in the codebase which is not needed for what we are shipping". This struck me as somewhat odd at the time, and still resonates as counter to how I would run a software organization... and in this blog post, I'm going to try to explain why, as best I can.
To start with, I suppose, this is not really a sentiment which is expressed much within smaller organizations, which had comprised the majority of my professional career to that point. In a small company, you're just trying to ship products that people want, and/or optimize your time to market, and rarely have the time to be concerned with existential concerns like leaving deleterious around in the wake of development. That is mostly the purview of companies with development teams, processes, and enough recurring revenue to support both.
My skepticism does not stem from an economic or matters of scale perspective, however. Rather, it is a bit more fundamental and philosophical, and would apply to companies of any scale. To explain, though, I'll need to briefly reference some concepts of code velocity and developer psychology, and how the larger picture fits together.
How innovation happens
There have been a number of books, posts, and other references made on how to encourage innovation, but the crux of most of these is just the idea that people need some unstructured time to experiment with things. Software innovation rarely (if ever) happens while implementing pre-defined tasks or closing tickets. Rather, this tends to happen when developers observe a problem, or something which can be improved, which is outside of their normal workflow, and they have the resources and support to be able to experiment with a new way to fix it. This is the motivation behind things like Google's "20% time", for example, various internal hackathons, etc.
A key component of these types of efforts is the idea that something may not pan out, and/or there may be multiple approaches attempted, and they while they may not converge to something of value, the efforts along the way are still valued. Note that this process might also take months, or even years, to converge into something which is a tangible improvement to the status quo. Often innovation happens "on the side" of main efforts as well, where some tangential work or idea can evolve into something new. All of this requires experimentation, and the internal freedom to create code which may never be used.
Consider also the velocity of code, something which I've referenced a few times previously, on this blog and otherwise (eg: https://codeslinger42.blogspot.com/2024/03/the-problem-with-process.html, https://codeslinger42.blogspot.com/2024/02/the-genius-of-fbs-motto.html, https://codeslinger42.blogspot.com/2024/10/just-say-no-to-code-freezes.html, etc.). Creating lots of code implies that some of it ultimately will not be used, or will be made obsolete by other code efforts, and that's fine. Constant refactoring and experimentation is arguably optimal in terms of overall code development, provided those efforts are aligned with business needs.
Developer psychology
The other really important aspect to consider in this discussion is developer psychology, something which is woefully under-considered within the industry in general. Despite the general purported understanding that developers are people, and their mental state affects development efforts, most managers and organizations tend to still treat them as mechanical parts. For a pertinent and related recent talk on the subject, see: https://www.youtube.com/watch?v=_dLLIjKz9MY
In relation to this concern, there's a material impact on productive output which is related to the friction, or "headwinds", associated with creating experimental code. If this has no perceived value unless the experiment yields something of tangible value, for example, then developers are strongly disincentivized from experimenting (as statistically, this is worth substantially less perceived value than working on things with defined scope and outcomes). This can also be the case if extraneous code is perceived as detrimental, for example, since in that context doing more than the bare minimum to accomplish assigned tasks would be potentially perceived as a negative.
Note that there are numerous other factors which are related to this and important in a broader sense, but I'm glossing over in the context of this specific topic. As one example, an arduous PR approval process where code changes sit without being reviewed and/or merged is one of the worst states a team/org can be in, and should be avoided at almost all costs. If your team is in this state, you have a fairly large and inexcusable failure of management there, full stop. If your process is actively discouraging your developers from creating value for your organization and/or solving customer problems, you must fix this, or your organization is unlikely to survive.
A proposed more ideal state, and "extra code"
In my opinion, and ideal development state (within a team) has the following properties:
- Developers have psychological safety to experiment with new approaches to solving problems
- Developers have some time and freedom to experiment with new approaches (even for problems which are not prioritized at the business level)
- Developers are constantly looking for ways to improve and simplify existing code, and are encouraged to do so (through the process and perceived value of such)
- Management understands that code is never "done"/static
- An incremental approach is generally preferred for large changes where possible (over "all at once in a big change" style changes)
This approach will create a state where many projects are "in progress" at any given time. This will imply extra code which is unused (and may never be used, depending on the outcomes of experiments). Sometimes this will come in the form of experiments, sometimes work in progress, sometimes "left this here as a note of something we tried and it didn't work", sometimes "this might be better in the future, but it's not worth changing now", and many other cases. In almost all cases, I'd consider this to be a "good thing": it's far better than the alternatives, and the costs of reading over some extraneous code are generally trivial in comparison.
In summary, then, I suppose I disagreed with the senior manager on this point, and continue to disagree to this day. In fact, I would say that if you do not have a significant amount of "extra code" generated and persisted in your development process, that might be an indirect indicator that something else is wrong. That's my opinion, anyway.