by wokwokwok · 6y ago · 0 comments
The explanation goes like this:
If you have no debt, you can borrow money.
If you have a bit of debt, you can borrow money, but you have to make regular repayments of maintenance to service that debt.
...but when you have a lot of debt, lenders are cautious about lending you money. Will you pay it back? Why didn’t you pay back any of your other debts? Can you afford the repayments?
The metaphor isn’t perfect, but the point being made is that maintenance is the repayments on technical debt; if ignore it, at some point you are going to end up spending all your developer hours on maintenance, and your throughput for features will grind to a halt.
You “repay” the technical debt by fixing stuff that causes problems, not by randomly rewriting it because you can’t be bothered reading the existing source code.
It’s not maintenance.
That’s a different thing; that’s making changes.
Technical debt is more like a metric of how prone to failure /what feature velocity your software is / has.
Sure, the metaphor falls over; you can just keep slapping broken features and other crap on top of either other indefinitely if you dont care if your existing features work or not... but, that’s a different issue.
This should be a cautious decision (and I’ve seen it happen many times, at individual/team/even org level). This is “tech debt”, and it does exist.
in an ideal world, yeah, that would be the cause, but in reality there are multiple other constraints:
- time constraint: you can not spend as much time as you want to make the perfect code (and that is ok, you want to ship and add value to the business so you continue to get your salary - see the extreme case of Duke Nukem Forever)
- dependency constraint: sometimes other teams requirement will affect your code quality
- cost constraint: again, you don’t want to go bankrupt
- competency constraint: there are juniors and there are people who don’t have the knowledge to perfectly cover your requirements
etc
It totally makes sense to take on technical debt in order to get your MVP out the door quickly; or to be able to fix an urgent customer issue; or to be able to make a release. And in some cases, it may make sense to keep technical debt around indefinitely.
What doesn't make sense is to pile on technical debt for no real benefit, and then not take any time to pay it down. That's like always buying things on your credit card just because you can and only making the minimum payments.
That does not mean technical dept is not a thing or not a real issue in certain codebases.
Almost every day I think about the potential technical dept of my code.
This is the wrong way to describe and explain technical debt. It fails primarily to sell the wrong idea that technical debt results from incompetence or failure to do a good job.
The truth if the matter is that in software development the absolute best solution to a problem is to provide an implementation that meets current requirements and is implemented as fast as possible. Overgeneralizing is bad code. Abstracting implementation details is a code smell. Proposing an implementation that considers additional design requirements and constraints is goldplating a solution, thus the sign of a mix of incompetence and wasted effort.
But then what if requirements change? Ah, the delta between the fast and good solution for the initial problem and adapting it with quick fixes to address the new requirements is precisely where technical debt pops up.
- competent programmers who do a good job write the best code in the shortest amount of time
- more time always leads to worse code (unnecessary abstractions, handling non-existent requirements)
If you do know of programmers who are competent and generally do a good job, you can disprove this claim easily: Have them write a solution to some problem in a given amount of time, then have them spend more time on it.
Often you can see that they actually achieve a “cleaner” solution, including removing unnecessary abstractions.
I do agree with you though that some tech debt is caused by a lack of skills/experience. I guess we could further divide tech debt between intentional (the one I wrote about) and unintentional (the one you seemed to focus on in your comment).
As much as it pains me, this is an undisputed fact. If you get two developers to implement the same ticket and both hit the definition of done, but while one takes an afternoon the other takes two weeks, who performed better? That's the reality of today's corporate software dev culture. The best code possible is that which meets the definition of done and is delivered in the shortest amount of time and preferably requiring the minimum amount of changes possible.
> - more time always leads to worse code (unnecessary abstractions, handling non-existent requirements)
No, that's not a function of time. The problem I stated is that in today's corporate software dev culture goldplating and over-engineering are code smells. Thus the pressure is placed on adding code that is less robust and adaptable to change. Consequently, technical debt piles up whenever new requirements emerge because the current culture puts a pressure on "good enough, delivered as fast as possible". Refactoring and redesigning and cleaning up are deemed unproductive tasks that deliver no improvements or new features, and whoever delivers more features is deemed a more productive developer. Hence, today's software development practices favours accretion which results in continuously growing technical debt.
That's a separate issue from technical debt because whether code is generalized is only one aspect of many that determines whether the code is a dream or a nightmare to work with.
For example, if all your variable and function names are vague and misleading because you didn't take the time to choose names that make any sense, that saved you time now and will cost you later, but it has nothing to do with generalization.
That's one of the problems attributed to goldplating and over-engineering solutions. One man's future-proof implementation is another man's unnecessary indirection that's a problem to maintain. Thus we end up creating an environment where rigid implementations that are prone to colossal amounts of technical debt are preferred over adaptable solutions that minimize or eliminate technical debt.
That doesn't strike me as the main point of the metaphor. The more debt you have, the more borrowing becomes expensive because you have to pay interest on the total amount; it grows exponentially (in the literal meaning) if you don't repay it. As many find out the hard way, it gets to a point where adding new features or fixing bugs takes insane amounts of time because you can't make changes without breaking everything.
Good examples of this are premature microservices, no good separation between modules, bad database schema design, etc...
It is all about proper balance. Too little debt is inefficient, too much and you are getting overwhelmed.
The metaphor for piling crap on crap would be a Ponzi scheme. You pay your debts by making bigger debts. It works as long as you find suckers, it will break down eventually.
I was going to write that there's no reason you'd want financial debt qua financial debt, and that's sort of true but I realized that credit ratings complicate things. Sometimes an important part of what you're getting in exchange for the debt (and its repayment) is capacity for borrowing more when it first-order matters in the future, by way of establishing a reputation for being able to handle debt correctly.
Mapping this back to software seems interesting. I can't think of a parallel for credit reporting agencies, but it's certainly the case that a team might be more (or less) willing to take on technical debt to meet the schedule desired by a manager or a PM if there is a history of allowing them room to pay down the debt later (or failing to).
Yes you actually do want debt because it is tax shield.
Under what circumstances?
What about https://en.wikipedia.org/wiki/Time_preference ?
Software is not the end goal for most businesses, it's a tool to get
In all* the places I ‘ve done work for if there were any uncaught bugs during peer review we would be mortified (‘we’ being whichever person wrote the code) and endure a day or two of gentle ribbing from the rest of the team (sounds a bit like bullying but wasn’t).
If anything we (the team) shipped had bugs in it that were discovered during client demos or even worse at the end-user stage it would be like there had been a death in the family in the department for the rest of the day. And this was at all of the places I’ve chiseled code on to clay slates in cuneiform at (ok slight exaggeration there).
The point I am trying to (badly) make is - When did the attitude of ‘code fast, push it out the door and fix in v2’ become the norm?
I mean, sure in my days(), there was always a massive push by sales to get stuff out the door, screaming pre-sales consultants* etc but the Lead Dev would always be the one having sufficient authority (and guts?) to say - ‘it’s ready when it’s ready and not till then’. Diplomatically of course.
Perhaps the difference was in the way that project time-scales and milestones were set. We (the devs) would always double any time estimate and ‘fight hard’ to get bargained down to say 9 days down from the original ten (eg). Usually if it was ready by the 5 days it should have taken we would release it. All time budgets always included a full day allocated for the entire dev team to kick the tires on it prior to releasing anything.
Consultants and Sales guys loved us (dev team) – They get their ‘toy’ early so had a few days to play around with it before the customer got it (hint, makes for a much slicker sales pitch) but also because they knew we (any team I’ve worked with or lead) took any bugs very personally. If you have never been in sales, Trust me – the inner cringe a sales guy feels as the demo app crashes is a tough thing to recover from when pitching to clients.
Perhaps I just got lucky and never came across a company that moved fast and broke things. I’ve certainly politely never returned on day 2 at a few gigs based on team moral, coding style, basecode etc so who knows? Certainly I know that being able to mock competitors that released buggy code helped ease the pain of explaining why any stuff we did was 3x – 5x more expensive than the median of the ‘get three tenders’ quote price range.
Ranging from government departments, an international consultancy firm, an international high net worth private bank, small (10+ employees) companies, various start-ups (mostly B2B integrators, B2C arbitrage etc), NGOs etc.etc. After that moved to RTOS running on custom chip-sets and then some on to some other fun stuff. Mention not as a boast (hence the throw-away account) but to illustrate that the teams and companies I have worked for all had very, very different cultures and mindsets. If I had no experience of a start-up environment or experience of bureaucratic orgs etc then I really couldn’t / shouldn’t / wouldn’t comment.
* = when still junior enough for it to be an issue.* (what are these days called Forward Deployed Software engineers I think)
All the smart things I ever read about technical debt basically describe debt and add the word "technical" - because that's what it is. It's not maintenance, it's not refactoring, it's just pure and simple debt.
Technical debt in software is unavoidable. Every variable and function and design decision can invariably be rebranded as technical debt soon enough.
The implication of "technical debt" is that there is a perfect state to reach with no debt, but there isn't. It also implies that debt could be avoided but it can't be, it's inherent to development.
"Repaying" technical debt is implementing the missing features, removing the temporary hacks etc.
Not taking it can be an option, if you have full funding upfront for example. It's just not always the best option. Just like borrowing money, getting into some technical debt can be worthwhile.
Well, that sounds a lot like maintenance.
> The metaphor isn’t perfect
But there's a difference between maintenance that fixes problems expediently and maintenance that fixes problems more permanently. The technical debt metaphor is an attempt to model the cons of doing the former too often (otherwise faster always seems better).