←back to thread

Code Is Debt

(tornikeo.com)
118 points tornikeo | 1 comments | | HN request time: 0s | source
Show context
skybrian ◴[] No.45087316[source]
Code that you can throw out at any time seems unlike debt? If you're in a hole, it must somehow arise from your attachment to it.

Maybe it's load-bearing and you need to change it?

replies(1): >>45087731 #
al_borland ◴[] No.45087731[source]
Having the debt doesn’t imply it has value. Debt is risk. Removing that old code also has risk. While it may not actually do anything anymore, can anyone say that with 100% certainty? At some point, you do all the checks you can, then delete it and hope nothing unexpected breaks.
replies(1): >>45090074 #
skybrian ◴[] No.45090074[source]
The easy case is when you can statically determine that a function has no callers and can therefore safely delete it. So it seems like risk comes from usage, or uncertainty about usage.
replies(1): >>45092755 #
1. al_borland ◴[] No.45092755{3}[source]
Just last week I was cleaning things up an Ansible repo and found a role to manage a dead product which wasn't called anywhere. However, the role contained a vars file that set a half dozen variables. Someone included that single file from the role somewhere else to set one or two variables they needed for something else that was largely unrelated.

In theory, we should have been able to delete that role without much thought, but without any extra layer of validation and some code updates, it still would have broken things.

The uncertainty is where most of the risk lies, especially when some people do odd things like this.