logoalt Hacker News

williamcottonyesterday at 10:43 PM7 repliesview on HN

Lines of code are meaningful when taken in aggregate and useless as a metric for an individual’s contributions.

COCOMO, which considers lines of code, is generally accepted as being accurate (enough) at estimating the value of a software system, at least as far as how courts (in the US) are concerned.

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


Replies

sarchertechyesterday at 11:18 PM

No one has any idea how to estimate software value, so the idea that some courts in the US have used a wildly inaccurate system that considers LOC is so far away from evidence that LOC is useful for anything that I can’t believe you bothered including that.

LOC is essentially only useful to give a ballpark estimate it complexity and even then only if you compare orders of magnitude and only between similar program languages and ecosystems.

It’s certainly not useful for AI generated projects. Just look at OpenClaw. Last I heard it was something close to half a million lines of code.

When I was in college we had a professor senior year who was obsessed with COCOMO. He required our final group project to be 50k LOC (He also required that we print out every line and turn it in). We made it, but only because we build a generator for the UI and made sure the generator was as verbose as possible.

show 1 reply
post-ityesterday at 11:20 PM

I think that's a "looking under the lamp post because that's where the light is" metric.

I'm not sure most developers, managers, or owners care about the calculated dollar value of their codebase. They're not trading code on an exchange. By condensing all software into a scalar, you're losing almost all important information.

I can see why it's important in court, obviously, since civil court is built around condensing everything into a scalar.

jonahxyesterday at 11:12 PM

> Lines of code are meaningful when taken in aggregate

The linked article does not demonstrate this. It establishes no causal link. One can obviously bloat LOC to an arbitrary degree while maintaining feature parity. Very generously, assuming good faith participants, it might reflect a kind average human efficiency within the fixed environment of the time.

Carrying the conclusions of this study from the 80s into the LLM age is not justified scientifically.

kqrtoday at 8:42 AM

COCOMO estimates the cost of the software, not the value. The cost is only weakly correlated with value.

keedayesterday at 11:18 PM

> Lines of code are meaningful when taken in aggregate and useless as a metric for an individual’s contributions.

Yes, and in fact a lot of the studies that show the impact of AI on coding productivity get dismissed because they use LoC or PRs as a metric and "everyone knows LoC/PR counts is a BS metric." But the better designed of these studies specifically call this out and explicitly design their experiments to use these as aggregate metrics.

renegade-ottertoday at 7:28 AM

I am writing a book! I used AI to write 1 billion words this morning!

BoorishBearsyesterday at 11:18 PM

> at least as far as how courts (in the US) are concerned.

That's an anti-signal if we're being honest.