←back to thread

Code Is Debt

(tornikeo.com)
118 points tornikeo | 9 comments | | HN request time: 0.618s | source | bottom
1. rappatic ◴[] No.45087890[source]
This is a shortsighted way of seeing things. The first issue, though surface-level, is using LOC as a measurement. If Company A’s million lines of code are cleaner, clearer, and better-documented than Company B’s 100k lines, then in that case Company A would be better off. What I’m getting at is that the author means to talk about complexity, and is using lines of code as rough measurement for complexity. Code itself is not debt, the complexity engendered by code is.

Code is an asset. It is the product of software companies. Having more assets certainly increases complexity, but this is almost definitionally true. Imagine saying “the US interstate highway system is debt, because it’s complex and difficult to maintain.” The premise is true, but the conclusion is such a one-dimensional way of seeing things.

The AI stuff aside, in light of the above, what is the author’s thesis here? “For the same code, all else being equal, it’s better to have less complexity than more complexity”? Sure, true, but that’s a pretty easy and obvious point.

It seems this entire article could have been profitably boiled down to “make sure your AI coding tools aren’t adding unnecessary complexity to your finished code.”

replies(9): >>45087961 #>>45088301 #>>45088506 #>>45088509 #>>45089090 #>>45090377 #>>45092979 #>>45093286 #>>45111951 #
2. ChrisMarshallNY ◴[] No.45087961[source]
I tend to look at cyclomatic complexity[0], in my functions. I use SwiftLint[1] to measure it, and flag functions that are too complex. Sometimes, I sort of kludge, and break the function into parts, but I usually find some way to do things more simply.

My files tend to be fairly long, but I also have a 50/50 comment-to-code ratio.

I'll bet that you could prompt an LLM to both reduce CC, and add lots of comments.

[0] https://en.wikipedia.org/wiki/Cyclomatic_complexity

[1] https://littlegreenviper.com/swiftlint/

3. robjan ◴[] No.45088301[source]
I'd say the software is an asset more than the code itself, much like an interstate is an asset rather than the concrete that it consists of. The quality of the concrete impacts the depreciation (reduction of value) of the asset and how much operational expenditure is required to upkeep the asset which would again impact the asset value. There's probably also a risk management angle which should be considered.
4. Terr_ ◴[] No.45088506[source]
Code is an asset/liability the same way that unstable volatile chemicals are.

If you use them promptly, in the right way, you'll make money. If you let it sit and degrade, or spill it, then it's a liability.

While source code--unlike certain chemicals--doesn't spontaneously change on its own, its fitness-for-purpose does, as the organization constantly shifts goals and process.

5. lukev ◴[] No.45089090[source]
Hmm, I actually think complexity is a red herring here.

Postulate that you have a viable software business, and work backwards from there. Everything else: every purchase and every pay period you pay someone to work for you is a cost, from this point of view, and undesirable unless necessary for the welfare of the business. But every cost is a step away from the platonic ideal of a business, one with arbitrarily high profits and arbitrarily low costs.

I agree that complexity is worse than simplicity, to the extent that complexity really is more expensive. But cost: whether long term or short term, capital or operational, is what really matters.

The question is whether LLM-generated code increases or reduces cost. Size, complexity, and a million other details not considered in the OP or in your comment all matter a lot.

6. auraham ◴[] No.45090377[source]
Why Can't We Make Simple Software?

Interesting talk about complexity: Complexity is when your systems interact. A complex system can become unreasonable. A complex system cab be generative and surprising!

https://www.youtube.com/watch?v=czzAVuVz7u4&t=257s

7. raxxorraxor ◴[] No.45092979[source]
Also the latest economic buzz to declare dept as something positive and not at all just a often blind defense for aching economic systems facing some pressures and problems, it would still not align too well with this anology.

And before someone tries to refute the "debt is mostly bad for the debt holder"-statement by some coked up economist in his first semester, I know how money is created today. I also know about the opportunity new debt can open. Doesn't make debt something positive, the field really lacks structured thought... I forgive you if you are the lawyer of Greece, but ffs... Some concepts are simple and fundamental.

I guess the author tried to connect debt and technical debt and there are certain similarities. In both cases work has to be done without direct compensation aside from working of the debt. Perhaps that is why it is called debt.

8. phkahler ◴[] No.45093286[source]
100k LoC vs 1M LoC to do the same thing is a big deal. Most likely the 1M code has a lot of redundancy and indirecting. It's just one measure but quantity is often bad.
9. hun3 ◴[] No.45111951[source]
> Code is an asset.

Funnily enough, this doesn't contradict "code is debt" because Asset = Equity + Liability.