News for hackers. Stuff that matters.
Re:Technical Debt by ljm on Tuesday May 21, 2019 @04:56PM (#19974921)
My only bone of contention is that taking on debt is usually a conscious choice. Technical debt to my mind is the price of making a pragmatic decision, it’s the trade-off that lingers.

Making poor architectural decisions or writing poor quality code isn’t tech debt. They are just institutionalised consequences. The way the world now works.

Legacy code isn’t tech debt either: it was right for the time.

What you have instead is knowledge debt as engineers turn over, and the once intuitive and elegant parts of the codebase are utterly alien to the new hires who learned their craft in a totally different way. This isn’t tech debt because engineers can’t intuitively anticipate the business’s future hiring decisions, particularly when those are made independently of the team.

If you want to establish tech debt you have to define the schedule to pay it off and there should be some record of that work somewhere, with accountability attached. It is not merely the accumulation of things you don’t like the look of or find hard to work with.

Similarly, I think MVP is a conscious choice to incur product debt because it is far too risky and irresponsible to go all-in with your perfect vision right off the bat. You want your initial buy in and a chance to bail out or pivot before all is lost.

Edit: as an example that comes to mind, a bank running on COBOL doesn’t have tech debt unless their COBOL engineers are aware of their missed opportunities. If they think COBOL is no longer fit for purpose, it’s not debt, it’s time to reinvest.

Re:Technical Debt by SkyBelow on Wednesday May 22, 2019 @09:07AM (#19980713)
>Making poor architectural decisions or writing poor quality code isn’t tech debt.

I compare technical debt to debt.

You may go in debt because you looked at the housing market and decided that now is likely a good time to buy a house with low interest rates. You take on a large load of debt, but it is done wisely based on currently information.

You may go in debt as a business operating on credit to fund an expansion that should pay off quite nicely in a few years time. Maybe it will fail, but it isn't a bad risk based on current knowledge.

You may go in debt for an education. Depending upon the degree and extent of debt this could be good or bad.

You may go in debt by spending beyond your means on a credit card. This is generally unwise.

You may go in debt because of a medical emergency that is entirely beyond your control (especially in some countries, but even some countries with universal healthcare it is possible to need treatment that isn't covered).

All of these have something similar when dealing with technical debt. Sometimes it is a wise investment. Sometimes it is a risk that may or may not pay off. Sometimes it is beyond one's control. Sometimes it is poor planning that will be regretted later.

Re:Technical Debt by coding123 on Tuesday May 21, 2019 @06:13PM (#19975673)
I think of all the code written as technical debt. As soon as you write it, it becomes a burden - just like regular financial debt. However instead of thinking of code like a credit card loan that will take a few years to pay off, think of it like a mortgage that you have for 30 years. At the 30 year mark, you will generally have retired the code, hopefully. If you're not so lucky, you should expect to see balloon payments coming shortly. I know this isn't a perfect metaphor because honestly "technical debt" applies to all code, not just slightly bad code. That's very different from a loan.
Re:Technical Debt by Jedd on Tuesday May 21, 2019 @06:36PM (#19975832)
I suggest that all code is a liability, rather than a debt per se.

This assumes all things can be usefully viewed through the prism and language of economics (though my gut feel is few things can or should be).

Re:Technical Debt by kweinber on Tuesday May 21, 2019 @07:49PM (#19976321)
The accounting world considers code an asset and allows you to amortize its creation.

Making progress in the world is fighting against entropy. Just because it is hard to fight the disorganizing efforts of the universe doesn’t mean that your output is a liability.

Re:Technical Debt by aaronchall on Tuesday May 21, 2019 @10:56PM (#19977326)
Liabilities are debts.

> liability: a thing for which someone is responsible, especially a debt or financial obligation.

According to the balance sheet equation,

> Assets = Liabilities + Owners Equity

Certainly all code is a liability - it must be at least understood and maintained from time to time (80% of lifetime cost is in the maintenance).

And while an accountant might also mark it an asset - not all code is an asset - and we recognize that fact when we delete for badness or disuse - or rewrite it to make extending and maintaining it easier.

Re:Technical Debt by Jedd on Wednesday May 22, 2019 @07:48AM (#19980103)
As intimated, I'm not sure that the fuzzy language and world of economics is the best way to view such things, however ...

I'd accept that debts are a subset of liabilities, but not that 'liabilities are debts'.

A debt implies an externality, while a liability implies some generic exposure -- it's that which I focus on when considering (all) code as a risk to an organisation.

I suspect, however, that we agree on the fundamentals. There's some cost and risk to developing and trying to maintain any code base, and accepting that can usefully inform development and operations work better than thinking of code as a (near-)risk-free asset.

Re:Technical Debt by RickSanchez2600 on Wednesday May 22, 2019 @02:54AM (#19978510)
Code is a liability it can be hacked if not written securely. It can be out of date if the language changes or Windows changes and the company upgrades, which means parts of it need to be rewritten.

I used to program COBOL on IBM 370 DOS/VSE systems they later went to Visual BASIC on Window 3.1 PCs. The conversion took a long time and most code had to be rewritten because COBOL is not BASIC. Management didn't care about that, they just wanted a working project. We all did our best going overtime without pay and working weekends to meet deadlines.

COBOL was a liability when they wanted to convert to Visual BASIC. There was liability to convert the code, convert from DB2 to SQL Server on the database end.

Re:Technical Debt by dfilppi on Wednesday May 22, 2019 @11:45AM (#19982409)
Overtime without pay is financial debt.
Re:Technical Debt by fnord123 on Wednesday May 22, 2019 @04:57AM (#19979235)
That's not debt. That's an asset. It's inventory. It has a maintenance cost in the sense that a truck has a cost of upkeep to keep it on the road.

Technical debt is configuration and plugins. You are able to deliver something now with the benefit of changing behaviour later but at the cost of having an enormously increased test surface and invasion into your type system with possibly hostile parameters.

Re:Technical Debt by emmelaich on Wednesday May 22, 2019 @05:26AM (#19979384)
I would say debt == investment.

You're betting that the maintenance foregone in the present is paid back with interest in the future.

This "pay back" could be the success of the company which allows you to pay for more developers and tools.

Is it worth it? Time will tell.

Re:Technical Debt by sonnyblarney on Tuesday May 21, 2019 @07:08PM (#19976077)
Without the code the company is nothing, so it's definitely not 'debt'.

If that were the case, the company would have a negative value.

Code is asset that requires maintenance.

But yes, it's definitely worth reminding ourselves of the ongoing cost of maintaining code.

Re:Technical Debt by jdgiese on Tuesday May 21, 2019 @08:41PM (#19976656)
> Without the code the company is nothing, so it's definitely not 'debt'.

I reconcile the concept that code is a debt with your statement in the following way:

The feature produced by a piece of code can be an asset, but the code itself is a debt.

Thus, for a new feature to be valuable, you want the value added of the feature (or asset) to out-weight the cost of the code (or debt).

As a general rule, the complexity that comes along with a piece of code grows as the code-base and feature set grows, thus, for a young codebase, the value of a feature more easily out-weights the cost of the code.

Re:Technical Debt by sonnyblarney on Tuesday May 21, 2019 @10:19PM (#19977158)
Anything in any other business terms that needed to be used, created or maintained to create value for customers would not be debt.

'Technical debt' is just not debt, it's just an interesting way to think about it, and a neat use of lingo.

There are any number of other business practices for which one could try to apply the same analogy, but it wouldn't work because very quickly the term wouldn't seem right.

For example 'training employees' for a situation, knowing they might need to be trained differently in the future, is not going to be regarded as debt.

Same thing for processes, investment in equipment, parts, materials etc..

Re:Technical Debt by lugg on Tuesday May 21, 2019 @10:29PM (#19977215)
It's a metaphor not actual money that can create a negative value.

Although, you could say that a lot of profitable companies have negative value codebases where the cost to rebuild them is less than the cost to maintain.

This probably explains why some companies get replaced by small nimble startups.

Re:Technical Debt by JamesBarney on Wednesday May 22, 2019 @12:09AM (#19977690)
> Making poor architectural decisions or writing poor quality code isn’t tech debt

I think it is. Technical debt is all about trading current productivity for future productivity. Poor architectural decisions can be caused by several factors. Inexperienced devs, not taking enough time to understand problem, not spending enough time brainstorming the problem. These are all decisions that trade current productivity for future productivity, which is technical debt.

Also most technical debt is not accrued consciously. Very few people are doing cost benefit analysis on technical debt. It's usually made intuitively by project and product managers who don't directly interact with the costs of technical debt but directly experience the benefits.

Re:Technical Debt by tremon on Wednesday May 22, 2019 @05:51AM (#19979489)
> Technical debt is all about trading current productivity for future productivity.

This is a very succinct and accurate description, and one I haven't come across. Thank you for this phrasing :)

Re:Technical Debt by collyw on Wednesday May 22, 2019 @04:57AM (#19979236)
> Inexperienced devs, not taking enough time to understand problem, not spending enough time brainstorming the problem

Requirements changing is also a big one. 4 years into one project that I had created and maintained a "one to many" relationship changed to a "many to many" in some of the tables central to the system. Something that I had clarified wouldn't when originally designing the system.

Re:Technical Debt by bryanrasmussen on Tuesday May 21, 2019 @05:15PM (#19975139)
>writing poor quality code isn’t tech debt.

sure it is, in the same way that taking one of those payday loans to cover a coke habit is still real debt, it's just real bad debt.

Re:Technical Debt by ljm on Tuesday May 21, 2019 @05:37PM (#19975329)
I don’t believe we can equate jonesing for a fresh hit to writing well intentioned but ultimately difficult code or the product of inexperience.

Besides which, it trivialises the seriousness and the tragedy of addiction. If you think your tech debt is similar to that you are well equipped to quit your job and work elsewhere. An addict does not have such an easy choice, they can’t leave their addiction to someone else and move on.

You choose to take the payday loan or hit up a shark, addiction or no.

The point where I concur is when you gamble the short term against the future despite all evidence that you will benefit from spending time to save time.

Re:Technical Debt by bryanrasmussen on Wednesday May 22, 2019 @01:03AM (#19977941)
all analogies and metaphors are in some ways inexact - indeed the whole concept of technical debt as a thing correlating to real debt is fraught with edge cases that don't exactly line up. Nonetheless if the metaphor has some utility then individual expressions of it such as mine will often have some utility - hence your concurring on a single point while finding other implications problematic.
Re:Technical Debt by UnFleshedOne on Tuesday May 21, 2019 @06:14PM (#19975688)
The victim in that metaphor is not an individual coder who can go work elsewhere, it is the org who takes on technical debt and sometimes can't function at all without the code in question.
Re:Technical Debt by therealjumbo on Tuesday May 21, 2019 @06:16PM (#19975704)
>I don’t believe we can equate jonesing for a fresh hit to writing well intentioned but ultimately difficult code or the product of inexperience.

Agreed. The addict might recover. Organizations with poor culture are doomed.

Re:Technical Debt by vsl on Wednesday May 22, 2019 @06:39AM (#19979723)
> I don’t believe we can equate jonesing for a fresh hit to writing well intentioned but ultimately difficult code or the product of inexperience.

That's not what "technical dept" is. Choosing a quick solution instead of a proper one that would take more effort is. I've made that conscious more than once myself: to hit a deadline, or because I didn't know if the MVP would even survive long enough to worry about code maintenance.

Re:Technical Debt by allenu on Tuesday May 21, 2019 @05:01PM (#19974990)
Totally agree. In my opinion, with this type of MVP strategy, work done should always be in the service of something else. Initially, an MVP is created to test out ideas and also to learn what structurally it takes to build your product.

After the MVP, you may wish to add more features or support more users, it is at that point that you can assess what is debt and what is not. It's not a matter of "cruftiness" but a matter of what's holding you back from adding additional features or supporting a larger number of users.

If we frame all work as doing something that will deliver some sort of value (be it customer value or unlock the potential to add more features to add customer value), then it becomes a more constructive conversation about work that needs to be done, debt or otherwise.

I'm not a fan of just looking at whether code is crufty or not to determine if it's "technical debt". If you look at code long enough, you'll find something you don't like and want to rewrite, but it has to be in the service of some other goal or else you'll just become an architecture astronaut building wonderful things that don't provide value.

Re:Technical Debt by stcredzero on Tuesday May 21, 2019 @05:15PM (#19975133)
Legacy code isn’t tech debt either: it was right for the time...

Edit: as an example that comes to mind, a bank running on COBOL doesn’t have tech debt unless their COBOL engineers are aware of their missed opportunities. If they think COBOL is no longer fit for purpose, it’s not debt, it’s time to reinvest.

Should there be an analogy for depreciation? Some of the "best practices" in my current C++ shop are in direct contradiction to the Law of Demeter and related philosophical stances in Object Oriented programming (particularly ones espoused by Martin Fowler) despite the fact that my current shop advocates for OO. Neither the old position or the my current shop's position is so bad that it's not viable, though some hotheads in the field act as though this could be the case.

A lot of the churn seems to be arbitrary and driven more by fashion than solid first principles. (Which would include cost-benefit analysis, for which there is often insufficient data, and for which no one wants to pay the cost to gather the data.)

Re:Technical Debt by jkoudys on Wednesday May 22, 2019 @10:13AM (#19981376)
Yeah, I see too often devs shrug off their "technical debt" when what they're really describing is simply sloppy work. These economic metaphors always break down when you challenge the idea that devs/dev managers are always acting in the best interest of the product. I've seen teams cheer their "velocity" because they're closing lots of issues, when most of the things they're focused on shouldn't have even been an issue in the first place.

For the cases like legacy code and turnover, perhaps "tech depreciation" is the more appropriate economic term. You didn't really borrow against the future to have more today, rather something naturally decreases in value over time.

Re:Technical Debt by olooney on Wednesday May 22, 2019 @11:41AM (#19982361)
Right. Technical debt should not be understood on its own but as part of a larger "technical balance sheet" metaphor: technical depreciation, technical amortization, and so on.
Re:Technical Debt by delusional on Tuesday May 21, 2019 @06:07PM (#19975622)
Where I work, we actually do use technical debt to cover unknown defects as well. So if a person writes bad code, or if we have some legacy code that has suffered from rot, we'd call that technical debt.

I think there's a lot of value to be found in separating the known debt from the unknown debt though, and giving it a name. I might have to start doing it.

So thanks for making me think about it.

Re:Technical Debt by eweise on Tuesday May 21, 2019 @06:31PM (#19975798)
"Legacy code isn’t tech debt either: it was right for the time." really? Isn't that what technical debt is, solution that no longer fits the current problem?
Re:Technical Debt by spydum on Tuesday May 21, 2019 @06:59PM (#19976005)
No, solution still fits the problem space but requires more than investment to improve efficiency/quality/etc of future management of the technology.

The cobol example is great - it is code still solving the problem but is no longer efficient or productive to find and pay cobol programmers.

Re:Technical Debt by eweise on Tuesday May 21, 2019 @08:35PM (#19976610)
If the code still fit the problem then you wouldn't need to pay a cobol programmer. If its hard to change the code because its too expensive to change, then you have tech debt.
Re:Technical Debt by adamdonahue on Monday May 27, 2019 @05:23PM (#20025357)
But it's only debt if business decisions mean you must change it. I've seen far too many programmers crawl through legacy code that need not be replaced (it does its job) merely because it's using an outdated technology. But if there's no business justification for that, I'd argue it's not debt at all. There is absolutely nothing wrong with some ugly COBOL code doing its job with no current need for modification. That's not debt. Debt is something you have to pay back.
Re:Technical Debt by kalecserk on Wednesday May 22, 2019 @06:55PM (#19986466)
Great comment, if you allow I would summarize by rephrasing one sentence making it shorter:

What you have instead is knowledge debt as engineers turn over, and the once intuitive and elegant parts of the codebase are utterly alien to the new hires who learned their craft in a totally different way. This isn’t tech debt because engineers can’t intuitively anticipate the business’s future.

That is it! Thank you for sharing your thoughts.

Re:Technical Debt by ses1984 on Tuesday May 21, 2019 @04:58PM (#19974950)
I don't see the distinction between knowledge and technical debt unless you count knowledge debt as a subset of technical debt.

You make a choice to accumulate knowledge debt by not writing docs, not cross training team mates, etc.

Re:Technical Debt by ljm on Tuesday May 21, 2019 @05:44PM (#19975399)
I count knowledge debt as a superset. You can’t determine the state of a codebase without first knowing the decisions that were made when it was being written.

This, and I will accept being wrong, is why I think we see code we didn’t write and immediately see how we would do it better. What we’re doing is sending ourselves back in time and replacing their shoes with our own. They didn’t know what you know and you have no idea what they knew.

A potentially effective approach is to introduce an immutable decision log. We have these people in many other fields - they record the decisions made and they become part of the overall reasoning.

I reckon anyone in a position of power should have an independent decision log. Tech architects, CTOs...

Re:Technical Debt by danielecook on Tuesday May 21, 2019 @05:59PM (#19975547)
> Legacy code isn’t tech debt either: it was right for the time.

Doesn’t this assume that code as written was of the highest quality? Under tight deadlines or misaligned priorities code quality suffers. Even if it works or “is right” doesn’t mean it wasn’t done to a standard that maximizes productivity.

Re:Technical Debt by ljm on Tuesday May 21, 2019 @06:04PM (#19975590)
I don’t believe so, I’m just saying it wasn’t seen as a debt at the time. It might well have been the best they could do given the constraints.

If they consciously chose to sacrifice on it, that’s the debt.

Re:Technical Debt by dragonwriter on Wednesday May 22, 2019 @08:31PM (#19987145)
> Legacy code isn’t tech debt either: it was right for the time.

The time it was written often isn't when the technical debt was incurred, when maintenance to keep it right, technologically, for the changing time was deferred, that's when a decision was made to incur a higher price later to save now: that's when the (technical) debt was incurred.

> as an example that comes to mind, a bank running on COBOL doesn’t have tech debt unless their COBOL engineers are aware of their missed opportunities

The existence of technical debt is unrelated to awareness of the deferred costs. “technical debt” isn't a statement about the existing technical staff’s perception of the system.

Re:Technical Debt by romwell on Tuesday May 21, 2019 @08:02PM (#19976408)
>What you have instead is knowledge debt as engineers turn over ... This isn’t tech debt

You know, if there only were a way to pass knowledge from one person to another aside from directly talking to that person. Perhaps if we had means of preserving knowledge, and even making it a part of the job description... But alas.

Joking aside, not writing technical documentation and product design docs is very much technical debt.

A lot of information that is lost with turnover is information that could have been written down and passed on.

Documentation is not jut code comments. It is:

-A solid bug tracking system, with clean and reproducible bug descriptions

-A version control history, where every change has a why in addition to a brief how, and which links with the bug tracker

-Well-written tests, which not only verify how a system works, but showcase how to use the APIs.

-Documentation for tests explaining why this input was chosen, what kind of output is expected, and why it was written that way

-High level comments in code (especially libraries) explaining how the API should be used

-High level documentation explaining the structure of the code that is checked in, and lives with the code. The documentation can be in Markdown or a plaintext README, but should be there

-A "code map" telling you what the code in various directories does, and where to look for things.

-And, most importantly, a lot of design docs - for every feature and algorithm. "We are solving this problem. Here are the alternatives considered. Here is what we are going to do and why. Here is how we'll implement this. We used ideas from this, this, and this paper".

Yes, all of that is needed. The price you pay is engineering time. But if you take on the debt, your new engineers will have Hours Of Fun[1] trying to figure out, say, whether the imaginary nanometers[2] model parameter increasing as a result of their change is a good or a bad thing.

What I am saying is documentation debt is technical debt. Documentation is just as important as the code. And having it does help[3].

You might think that your code doesn't need all of that. And that's fine; but that means you plan on never paying that debt. Maybe you plan for your startup to fail/sell out in a few years. Maybe you plan to leave that job. But anything long term means you have to write things down.

And if you haven't been doing so - now is as good time as ever to start.

[1]http://wiki.c2.com/?HoursOfFun

[2]True story. There was a good reason for why the distance parameter had complex-valued nanometers as units; it was an elegant way to do improve a model while staying backwards-compatible. It was written down nowhere, and have fun googling "complex nanometers". They only exist in that code, AFAIK.

Re:Technical Debt by dredmorbius on Tuesday May 21, 2019 @08:50PM (#19976720)
There is information which is readily transmitted through non-experiential means: tacit knowledge. Books, lectures, conversations.

There is information that must be experienced, drilled, and committed to habit and muscle memory: tacit knowledge. Drill, practice, experiment, coaching. Often 1:1 or at least 1:few.

It's highly arguable that individual knowledge does not become cultural knowledge until a means of transmitting it from one generation to the next becomes both established on institutionalised. It need not be a large institution, but it must have persistence.

Within any knowledge domain, the explicit knowledge transmits more readily than the tacit. With time and complexity, I suspect a situation much analogous to Amdahl's law is reached, in which generational knowledge transfer comes to be dominated by the tacit component -- it is harder, slower, and more expensive to transmit, and tends to irreducibility.

Technical cultures which become or incorporate a tradition of shared stories and lore, as Unix and Linux have done, seem to achieve this better than others.

And that neglects issues of semantic and cultural drift which affect written texts.

Though I'd come to this conclusion some years ago, I'm finding reading Mortimer J. Adler's How to Read a Book that this is a significant theme of that work.

https://en.wikipedia.org/wiki/How_to_Read_a_Book

Re:Technical Debt by dragonwriter on Tuesday May 21, 2019 @06:33PM (#19975810)
> Legacy code isn’t tech debt either

“Legacy code” is usually a label applied exactly to identify that code which has been determined to represent technical debt.

Re:Technical Debt by charrondev on Tuesday May 21, 2019 @06:39PM (#19975855)
I heard a recent conference talk where it was referenced as “Revenue Generating Code”, rather than “Legacy Code”.

I found it be a pretty accurate summation that gives some perspective from the other side.

Re:Technical Debt by dragonwriter on Tuesday May 21, 2019 @06:58PM (#19975993)
> I heard a recent conference talk where it was referenced as “Revenue Generating Code”, rather than “Legacy Code”.

The two categories overlap, but not all code generating revenue fits in the traditional scope of “Legacy Code” and not all “Legacy Code” is generating revenue.

> I found it be a pretty accurate summation that gives some perspective from the other side.

What “other side” are you referring to?

Re:Technical Debt by charrondev on Tuesday May 21, 2019 @07:21PM (#19976156)
It’s not a perfect overlap. I agree with you there. My personal experience has led me to believe that “Revenue Generating Code” is the most common variety of technical debt.

Technical debt that does not generate revenue in any way is often far easier to replace/refactor.

I look at legacy code like this:

- Could we remove this from the product? - Could we replace this part of the product with a totally new system? - Are we OK with potentially introducing subtle bugs in this code as we work through refactoring it.

If the answer to the above questions are “No”, it’s likely revenue generating code (or part of some compliance process).

In this case the “other side” is non-technical stakeholders who don’t inherently understand the importance of resolving technical debt.

Re:Technical Debt by tomrod on Tuesday May 21, 2019 @06:35PM (#19975824)
Agreed. Technical debt is the accrued cost of maintenance -- underpaying maintenance is a typical recipe for poor outcomes.
Re:Technical Debt by goto11 on Wednesday May 22, 2019 @10:50AM (#19981791)
Technical debt is a great metaphor exactly because it suggest the suboptimal code is due to a deliberate strategic decision.

If you just say that some code is bad you will get unproductive reactions like people getting defensive, trying to assign blame etc. Calling it technical debt allow you to call attention to an issue while avoiding blaming anybody.

Re:Technical Debt by philwelch on Tuesday May 21, 2019 @10:42PM (#19977275)
If you buy thousands of dollars of unnecessary crap with your credit card, you’re still in “debt”, so the analogy still holds.
Re:Technical Debt by azernik on Tuesday May 21, 2019 @06:20PM (#19975727)
It was right for the time, and required maintenance and updating; I consider skipping said maintenance to be a debt of the time it would take to do that maintenance, with the interest being the time spent working around it as you work on other things. In a lot of cases, the interest rate is pretty low, and is worth it.
Re:Technical Debt by dep_b on Wednesday May 22, 2019 @06:29AM (#19979679)
The goal of an MVP is not to write crappy code to get something quickly out of the door but to not build every feature into all details to get all of the parts together and see how they work first. It's about the code you don't write, not about the quality of what you do write.
Re:Technical Debt by martin_ on Wednesday May 22, 2019 @12:09AM (#19977689)
This is great and well articulated! Would you agree legacy code can often turn into tech debt by virtue of being neglected / unmaintained? The debt here could perhaps be measured by operational overhead