You can write the shittiest spaghetti code in the world, and if you never have to build upon - or touch it again - you took on zero technical debt.
In comparison, if you write just slightly flawed design, but build out your complete featureset based upon that flawed design, you could have mountains of technical debt.
I think a better analogy is building a structure. If your code is foundational, you better get that shit right. If you cheap out on a $20 part and have to replace it, but it's just a door knob, that's not too bad. But if it's under your slab on grade foundation you're going to pay thousands to dig it up and fix a $20 part.
https://technology.riotgames.com/news/taxonomy-tech-debt
It breaks it down along three axis:
* Impact. How much it affects things.
* Fix cost. How hard is it to fix.
* Contagion. How much it spreads over time. If a piece of tech debt is well-contained, the cost to fix it later compared to now is basically identical. On the other hand, some forms of tech debt keep giving. Image if your string type has some issues.
Linking that back to the debt analogy, there are different interest rates for different kinds of debt, depending on how contagious that part of the code is.
Otherwise, you always have to deal with it eventually. Look at the Y2K problem. or how the 2038 problem is starting to crop up already, exposing significant levels of technical debt. https://twitter.com/jxxf/status/1219009308438024200
I also think technical debt does accrue interest over time, albeit not as linearly as a modern installment-plan debt does. That's because it slowly falls out of sync with people's memories. With libraries, with operating systems, with techniques. Bad code I wrote 10 minutes ago is pretty easy to clean up. But the next day, the next month, the next year? The cleanup gets more expensive. At some point the work becomes more archaeology than normal programming.
It's also true that actual foundations have something in common with foundational code. But that's a different aspect of programming than what tech debt is pointing at.
> Most operating systems designed to run on 64-bit hardware already use signed 64-bit time_t integers. Using a signed 64-bit value introduces a new wraparound date that is over twenty times greater than the estimated age of the universe: approximately 292 billion years from now, at 15:30:08 UTC on Sunday, 4 December 292,277,026,596.
There are plenty of counter-examples, but I like the example of video games.
https://www.polygon.com/2020/1/13/21064100/vvvvvv-source-cod...
There's a pretty clear ship date, after which you never touch it again.
Even in the world of SAAS, there are plenty of services or libraries that you write that serve a single purpose, are good enough, and never get touched again.
Even the code you mention isn't a great example for your case. In theory it was throwaway, but now that it's out there, you can bet that plenty of people will be touching it. And you're also ignoring the path not taken. This beloved game didn't get a sequel, despite plenty of demand. If the code were in better shape, might it have had one?
I don't really agree with this view; it may seem pedantic, but I think it's better to consider that case as tech debt.
In my experience, it's incredibly uncommon to write code and never touch it again -- particularly if you elect to cut corners in the interest of getting something out the door quicker. That code inevitably either gets retired because it's not being used (your debt was forgiven), or gets built on top of (your debt starts to compound).
If you make a decision to lower the quality bar because "we are not going to touch this again, so it's not tech debt, so it doesn't matter", then I think you're fooling yourself. Instead, I think it's better to assume that you're taking on tech debt (you almost certainly are), apply all the best practices around managing that debt (i.e. catalog it, be aware of your overall debt level, and be aware of tech debt in critical systems), and be happy if your debt is later forgiven if you miraculously never need to touch that code again.
Maybe there's a narrow sense in which this position is technically/semantically correct, but I think more often than not, this position is going to hurt you more than it helps.
> Technical debt consists in performing a fix or development in a quick and dirty way because it takes less time, even though it will make the code harder to work with in the long term.
If you aren't going to be changing the code later, then writing a bunch of spaghetti code won't make it harder to work with in the long term.
I like the Tetris analogy because that game has a type of debt that anyone who has played it can understand, yet is not as easily quantifiable as financial debt.
You might owe a debt to the mob. Perhaps they help you out of a sticky situation but let you know that some unspecified favor will be required in the future. So you have a debt, but what exactly you owe is loosely-defined and might cause great chaos in your life at some inconvenient point when it's time to repay.
If the debts were thoughtful and deliberate with understood risks, they might make perfect sense.
If the debts were taken by people who couldn't evaluate them and had no business making that decision, it's going to be bad.
Odds are the first are well-understood and maybe even documented. The second may explode when the underlying assumptions or risk changes.
Engineers sometimes want to overengineer things that would work just fine in that situation. I remember an old link about someone studying the source code of a game (Doom maybe) expecting to find beautiful solutions for every minor problem when in fact he was surprised by how most of it was straightforward.
Check what needs to scale/be resilient before reinforcing the code there (and of course, if the solution is already frail at the moment it probably needs to be fixed sooner rather than later)
(bonus: write your code like the next person to work on it is a psychopath and they know where you live)
For business school grad PMs I like to see if they can run with an analogy to selling unhedged call options rather than thinking of it in terms of debt with a known payoff schedule.
Even the bankers got derivatives wrong at an epic scale.
So, you mean today? The number of students that take on crippling amounts of student loans without truly understanding how it will affect them is staggering to me. The ease of obtaining credit before a person truly understands how devastating 20%+ interest rates are is also pretty telling. Financial debt is easy to get wrong, and is only compounded by the fact we don't teach this as a basic course in primary schools.
Or just large numbers. A valid strategy to invest a million will be worthless with just a dime. No matter what the silly myths of success say.
I think this metaphor does a good job of capturing the path-dependant nature of debt. How the size of each individual debt sits in the shadow of the code that relies on the flawed code. Understanding that there's the work of fixing technical debt and the work of getting to the place where you can fix technical debt feels more clearly communicated by tetris than by financial debt.
Technical debt is not well understood, and its impact is not easy to measure.
This analogy is probably why so many companies make the (usually wrong) decision regarding technical debt.
Cleaning up one kind of issue in your code doesn't affect other kinds of issues, and you can end up with fundamental architectural problems that no amount of testing or clean up can compensate for. You can handle some issues incrementally (eg adding tests), but some issues are going to be so fundamental to your system that you can only handle them by making a lot of changes all at once.
You can't refinance technical debt!
That kind of debt, right?
But wait there's more! I forgot to mention that even if you walk away you get to keep what you bought on credit, without any further payment of any kind and it continues working in its current state, forever - you just can't improve or renovate it if you walk away from the debt.¹
That kind of debt, right? If so then perfect analogy.
-
¹ literal lie though, yes you can. you can totally still improve it real quick. I'm afraid I'll have to add $150,000 to your technical debt though, which you can walk away from any time. still want this real quick $50 change though? It might be $50 but it's $150,000 in debt though.
So, excluding the actual strawman numbers, analogy still holds very well.
I "defaulted" on the loan of replacing a script I wrote in 2 minutes in autohotkey (a windows scripting language). I'm never going to write it properly.
Now explain to me how defaulting on this technical debt has hurt my credit rating.
Is the next time I open a new autohotkey script is it going to say to me "Now wait a minute. What about all the debt you defaulted on last time? I'm not going to let you write a quick and dirty script! You'll default on ever rewriting it! Go do it properly as a source controlled project in Microsoft Visual Studio. I am not letting you write another script."
Is that what happens? No?
That autohotkey script is running now. Where's the debt? How is my credit rating worsened by defaulting on it?
It's debt you can default on at any time without any consequence, while being able to continue to use what you bought on credit.
Your version is like saying that the minute a squatter takes up residence in an abandoned building, he's just gotten $140,000 in debt, the cost of buying some land nearby and building a proper, albeit unfinished building with no electricity or heating.
And if, still in his abandoned building squat, he finds and burns some wood in the winter, watch out! He's just added $25,000 in debt to the $140,000 he already had, since that's what a proper HVAC system will cost in his properly built building. He went from $140,000 in debt to $165,000 in debt the minute he set fire to some wood.
But that's clearly very wrong. Maybe he'll live in that abandoned building for 4 years and then just walk away. Poof. The $165,000 in lousy-analogy debt disappears the moment he walks away.
It's not debt. It's a lousy, bad analogy.
One of which is that it is often really hard to quantify, but that does not seem to stop many non-technical manager types from trying to treat it like financial debt nontheless.
Another one is that unlike financial debt, which should be controlled by various organization-internal mechanisms, tech debt is often not something management is conscious about (at least when it is "created"). I've seen far too many examples of horrible code that can simply be explained with lazyness or incompetence, but I'm pretty sure management never called for a hard to use, unnecessarily complicated API.
Also, if the tech debt is caused by management, it is usually an implicit byproduct of unrealistic time constraints, and I'm pretty sure in those cases they would often choose find another solution too if they were conscious about how bad the problem they're creating really is.
Edit: Either that, or their incentives are way off because they don't have to deal with the consequences. Which is also the real cause why financial debt is usually strictly controlled.
Most of what people call debt, though, is really just comprises. Which works, to me, as you can just say the code is too compromised. :)
There is nothing wrong with taking out a mortgage (and thus getting into debt) to buy a house - you just need to understand how to pay it off. Similarly, if you start a startup trying to find product-market fit before running out of money, there is nothing wrong taking on technical debt to do so, as long as you understand what you are doing.