by jakelazaroff · 3y ago · 0 comments
Calling it “bad code” definitely misses the mark. IMO, it’s code that constrains you from doing things you want to do. Tech debt is almost always code that is tightly coupled to other code, which is why getting rid of it or working in codebases with a lot of it can be difficult.
The key is that (again, like financial debt) you need a plan to pay technical debt down. If there’s too much, you start drowning in it. And not all of it is a choice — sometimes things unexpectedly change and current code becomes a liability. But framing technical debt in architectural decisions as a tool and a choice has helped me understand better how to accomplish business objectives as an engineer.
Every database, application, and workflow in the company has to deal with possibly 8 different part numbers when referring to a release of software. From the mainframe, to the PDM to the ERP to every single ad-hoc Excel spreadsheet used by every department to help manage the complexity.
Most of the parts are shared across various builds, with 2 or 3 of the "subfiles" being different. So, in a release of hundreds of various custom softwares for a particular hardware product, there are hundreds-times-5-to-8 subfiles released. Each software must be broken apart, checked for commonality, and rebuilt using the common files, and then checked against the base build to make sure that it rebuilt correctly. Each release of software requires LITERALLY DAYS of work to do this, even with Excel macros.
I wrote software to automate all of this. It took a half an hour, with NO manual intervention. It was strangled in the crib.
WHY do we do this? Before WAN's became de rigueur, we took our software to the computer on the production lines that programs the embedded computers on floppy disks, and the software had to be broken up into 8 parts so that it would... fit on a floppy. We operate with a built-in technical debt that hasn't been needed for 30 years which would literally break the company to address. It's virtually unseen at this point.
If there's a worse example of "technical debt," I'd love to hear it.
> I wrote software to automate all of this. It took a half an hour, with NO manual intervention. It was strangled in the crib.
Can you say any more about why management at your company decided to strangle this project in the crib? What exactly happened? If you tried to pushback, how did they shut you down?
If you have time I'd also be curious to hear an outline of how your solution fixed things.
I wrote an application (in engineering) that did a thing that everyone loved. It had a thousand internal users. Another group (in IT) thought my project was their domain, and tried to kill it. When they couldn't, they staffed up and wrote their own version. I wrote mine in a year and a half; it took them 10 people and 3 years. Their version sucked so hard, no one would use it. They hired Microsoft to help them make it better; they failed.
In frustration with the situation, the IT manager managed to replace my boss' boss with someone he had mentored into the company, and lo and behold, we were told to stop working on my project. We made a patch to fix a bug, and they feigned outrage, and pulled the plug and made us hand over my application, which has now run for about 6 years without update, while they try to force more people to use their piece of junk. I hear they've gotten most people transferred now.
Right about the time the management change was happening, my boss and I were starting to go off in several directions of other useful things we could do with the data. One of them was the function I mentioned. It was a very manual process, but very scriptable. I created a message queue in Azure, to "release" the job, and had another machine (with a proprietary program this process needed) pick up the message and just crank through it. I had just gotten that done when they pulled the plug, and it was never used in anger.
A lot of times, people tell war stories like this, and you think, aww, come on; it couldn't have been THAT bad. But this bad enough that the CIO called the IT manager to a special meeting about it, and he was reassigned to a lead a new group. You're free to speculate if that was a promotion or a chastisement. My boss thinks it was the former. I'm not so sure.
There is always the urge to build something "the right way" where it's fully modular and extensible, but if you never need to extend something the additional layers of abstraction end up being more of a hindrance than a help.
There is a certain level of efficiency in building things the cheap and easy way by default and only rewriting the parts where it was actually a problem.
I've seen developers reduce technical debt in a way that others consider to be an increase in technical debt.
One developer can add abstractions, modularity and extensibility to a code to reduce technical debt.
Another developer can strip out unneeded abstractions, modularity and extensibility to reduce technical debt.
Often noone does
Defaults exist. You don't always have to pay financial debt, and the case you described for technical debt is one of the main cases when people don't pay financial debts either.
IMO the biggest difference is that the carrying costs of technical debt are quite random. But people say that all the time already, and it's well known that they behave more like generic liabilities instead of debts in particular.
It's really surprising how often the “quick” approach turns out to be slower than the “right” approach.
Now sure, there's such a thing as focusing too much on non-market relevant aspects of a project, or going down rabbit holes, or designing and coding for a future that will almost certainly never come, but it still continues to surprise me how often when the choice is between "quick" or "right", that "quick" actually turns surprisingly soon into slow.
There's a saying apparently in use in the military "slow is smooth, smooth is fast". That's the kind of wisdom we need to aim for in software engineering. "More haste, less speed".
Oh yeah, the other difference is that there's no external force that will take you to court if you don't pay down technical debt, so in fact most organisations are terrible at paying it down. If you don't literally have a plan on the calendar with names and dates committed to improve the code, you're most likely fooling yourself by calling it technical debt. The true metaphor is much closer to 'Superfund site'.
And it's really surprising how few people realise that, even if the "quick" approach is slower in the long term, time is not always worth the same!
Time just before release is precious. Just after release, instead, you are both tired anyway and still have your code in your head, so that is the right time to refactor.
In the end, technical debt, code quality, and whatever code metric... they only make sense for code that has been shipped. The code you are refining is worth nothing if users are not already using it.
That really only applies to "we have to launch it next week". In vast majority of projects longer than a hackathon doing even slightly better (let's say extra 20%) pays off very quickly. Because there is plenty more shades between "let's do that in immediately simplest way with zero thinking" vs "let's build our own DB engine to handle the problem". With exception being maybe "we're just prototyping few approaches to the problem"
The "but we need to be agile and launch fast" is more often excuse than legitimate reason.
It can potentially apply to any project with a fixed budget, whether that's internal or external. And time is money, sometimes quite literally if you are working in the agency world. Customers will choose a project with a $50k budget versus a $80k budget even if smaller budget will be significantly worse, as long as it meets one of their basic needs (or even if it doesn't, if that's all the budget they have to work with).
I have often seen developers weigh up doing it 'right' or doing it 'quick', and the 'quick' solution turns out to have more complexity than originally anticipated, and take a lot longer than expected. Sometimes the reason the 'quick' way seemed quick was just because the problems with it were less understood.
The 'right' solution generally is harder, but the 'right' solution is better understood, and people can be surprisingly productive on things they understand and believe in when they knuckle down and get to it.
The best “quick” vs. “right” decisions I’ve made (and this is not a binary) have involved 1) complete plans for both implementations, 2) a plan to migrate from “quick” to “right” and sometimes 3) a plan to remove the “quick” implementation if the feature turns out to be unneeded. It involves more upfront planning work, not less. 3 is particularly useful because it forces you to come up with the loosest possible coupling between the new feature and the existing system.
For example our call center needed staff availability surfaced in the CRM for routing calls. This required data from the HRMS and the individual's work calendar. We knew the HRMS system was being replaced in Q4 of this year, but the project timeline dictated this feature would release in Q2. Thus we have a tech debt item added to the backlog to refactor this integration when the new HRMS system is launched.
Another example that comes to mind happened a few years back. We had a product using a framework that was falling out of support. That itself was naturally emergent tech debt.
When the tech debt item was finally added to a sprint, the upgrade options were to a LTS version or an STS version after that. The feature that had delayed the tech debt for so long had been refactored again for the STS. The decision was made to skip the LTS version in favor of the STS version because it would save a huge refactor in the future. However being an STS version, it necessitated another tech debt item to upgrade to an LTS version in a year.
Your first one is just a new requirement (to integrate with a new system) that you can see coming down the road. You didn't make a decision that took on any 'technical debt' there.
Your second one is that the framework you were using fell out of support. Unless you had previously decided to use an old version because it would allow you to release earlier, you didn't take on tech debt here, you just needed to do some work to stay on a supported version of the framework.
Your last example where you chose to go to an STS version instead of an LTS version might be a good example, since you made a decision that forced you to do some upgrade work in the future sooner than you would otherwise have had to. On the other hand, it doesn't seem that you took on technical debt in making that decision, if anything, your tech is probably better and less indebted than if you hadn't. Perhaps I'd say you took on schedule debt or something else there.
I suspect that you work for an organisation where anything that isn't a customer requested feature is considered 'tech debt', but I think that's a too wide use of the term.
I'm defining tech debt as a decision that expedites short term delivery but creates a need for future work.
The first case was deciding to deliver a product sooner while knowing that decision would create necessary work in the near future. The second wasn't properly clarified but the version of the framework in use was STS.
I suppose it's up for debate if routing maintenance is tech debt or not. I'm of the opinion that it is.
> I suspect that you work for an organisation where anything that isn't a customer requested feature is considered 'tech debt', but I think that's a too wide use of the term.
Yarp.
It depends on what is done fast and what is done more thoughtfully. For example, if the general architecture is thought through carefully, individual modules can be built more hastily and later rewritten. On the other hand if the architecture is unsuitable for the problem, then it matters little how well tested or high quality any of the code is, and overdoing code quality will be a waste of time.
It comes down to judgment and tradeoffs (like everything in engineering). I like the concept of tech debt because it is a way of describing a class of tradeoffs.
Is organizational or technical debt good for the company? No. Is it good for the individuals creating it? Oftentimes yes, they never have to pay it back, they get to hire someone to deal with the mess instead.
While technical debt in itself is not a good thing, choosing to take on tech debt in return for delivering quicker (getting faster feedback/not investing in an implementation too early/not over-architecting before you have real-world impact) can certainly be the right choice for the organization as a whole.
I don't buy the argument that tech debt is purely a selfish choice for personal benefit.
If startups were staffed only by experienced workers, some aspects would go more smoothly, but costs would be much higher. Arguably YC's value prop to downstream investors is its ability to find superb teams early and invest when doing so is cheap.
This is why we adopted the concept of technical debt, the term encompasses much, more more than just "bad code."
I think it's a great term.