[HN Gopher] -2000 Lines of code
___________________________________________________________________
-2000 Lines of code
Author : xeonmc
Score : 101 points
Date : 2025-06-25 19:53 UTC (3 hours ago)
(HTM) web link (www.folklore.org)
(TXT) w3m dump (www.folklore.org)
| daitangio wrote:
| Software metric are hard, indeed :) Be prepared in a ai-code
| world when more code does not mean better code.
| bunderbunder wrote:
| I've been watching my colleagues' adoption of Copilot with
| interest. From what I can tell, the people who are the most
| convinced that it improves their productivity have an
| understanding of developer productivity that is very much in
| line with that of the managers in this story.
|
| Recently I refactored about 8,000 lines of vibe-coded bloat
| down into about 40 lines that ran ten times as fast, required
| 1/20 as much memory, and eliminated both the defect I was
| tasked with resolving and several others that I found along the
| way. (Tangentially, LLM-generated unit tests never cease to
| amaze me.) The PHBs didn't particularly appreciate my efforts,
| either. We've got a very expensive Copilot Enterprise license
| to continue justifying.
| api wrote:
| I see a stratified software market in the future.
|
| There will be vibe and amateur banged out hustle trash, which
| will be the cheap plastic cutlery of the software world.
|
| There will be lovingly hand crafted by experts code (possibly
| using some AI but in the hands of someone who knows their
| shit) that will be like the fine stuff and will cost many
| times more.
|
| A lot of stuff will get prototyped as crap and then if it
| gets traction reimplemented with quality.
| librasteve wrote:
| yeah this is it ...
| doesnt_know wrote:
| This was said about large frameworks like electron on the
| desktop, but outside of some specific technical niches it
| literally doesn't matter to end users.
| kbelder wrote:
| It does matter and they do care; they just don't have the
| specific technical knowledge to pinpoint _why_ their
| computer sucks now.
| Miraste wrote:
| Where's the part where it's different from the existing
| market?
| bitwize wrote:
| Back in the day, if you went to a website you could always
| tell who wrote their HTML by hand and who used a tool like
| GruntPage, Dreamweaver, etc. even without looking at the
| META tags. The by-hand stuff was like a polished jewel that
| had only as much layout, styling, and markup as needed to
| get the desired effect. The proprietary web editor stuff
| was encrusted with extraneous tags and vendor-specific
| extensions (like mso: attributes and styles in GruntPage).
|
| Then as now, if you let the machine do the thinking for
| you, the result was a steaming mess. Up to you if that was
| accessible (and for many, it was).
| wffurr wrote:
| You can make the same claim about compiled code vs hand
| written assembly, and yet the vast majority of software
| is compiled or interpreted.
| DowsingSpoon wrote:
| In the past, hand-crafted assembly code was common
| because it was easy to beat the compiler. This is still
| true today in some niches.
| dgfitz wrote:
| A compiler is written by very smart humans to a spec
| written by humans, also probably smart but I don't know
| enough to claim that bit.
|
| An LLM is just displaying the next statistical token.
|
| Completely different.
| bitwize wrote:
| Or, as I like to put it, pulling out the next
| refrigerator poetry tile from a stochastic bag of
| holding.
| robocat wrote:
| A beautiful vision.
|
| If the vision were true, we should see it happen with
| normal goods too. Quality physical goods do not beat the
| shit goods in the market : crap furniture is the canonical
| example (with blog articles discussing the issue).
|
| Software (and movies) is free for subsequent copies, so at
| first sight you might think software is completely
| different from physical goods.
|
| However for most factory produced goods, designing and
| building the factory is the major cost. The marginal cost
| of producing each copy of an item might be reasonably low
| (highly dependent on raw materials and labor costs?).
|
| Many expensive physical goods are dominated by the initial
| design costs, so an expensive Maserati might be complete
| shit (bought for image status or Veblen reasons, not
| because it is high quality). There's a reason why the best
| products are often midrange. The per unit 2..n reproduction
| cost of cheap physical goods is always low almost by
| definition.
|
| Some parts of iPhone software are high quality (e.g. the
| security is astounding). Some parts are bad. Apple
| monetisation adds non-optional features that have negative
| value to me: however those features have positive value to
| Apple.
| switchbak wrote:
| "8,000 lines of vibe-coded bloat down into about 40 lines"
| ... I just saw a vision of my future and shuddered.
|
| I mean, I like killing crappy code as much as the next guy,
| but I don't want that to be my daily existence. Ugggh.
| 0cf8612b2e1e wrote:
| I would love to know the time balance between the two
| activities. It takes nothing to generate slop, but could be
| weeks to extricate it.
| Izikiel43 wrote:
| > Tangentially, LLM-generated unit tests never cease to amaze
| me.
|
| In a good or bad way?
|
| I've found AI pretty helpful to write tests, specially if you
| already have an existing one as a template.
| 2muchcoffeeman wrote:
| I don't believe your numbers unless your colleagues are
| exceptionally bad programmers.
|
| I'm using AI a lot too. I don't accept all the changes if
| they look bad. I also keep things concise. I've never seen it
| generate something so bad I could delete 99 percent of it.
| WD-42 wrote:
| 90%+ is a stretch. Anecdotally I have cleaned up a vibe
| coded PR and removed at least half of the code. The thing
| with the LLM is that often they will make some decision up
| front that has downstream ramifications for how the entire
| project's code is structured. I don't think I've seen an
| LLM re-visit it's assumptions, instead they code around
| them.
|
| In the case I saw, it was rust code and the LLM typed some
| argument as a Arc<Mutex<_>> when it absolutely did not need
| to, which caused the entire PR to inflate. The vibe coder
| apparently didn't catch this and just kept it vibing...
| Technically the code did what it needed to do but was super
| inefficient.
|
| It would have been easy for me to just accept the PR. It
| technically worked. But it was garbage.
| 2muchcoffeeman wrote:
| Yes. This is why I'm still "designing" projects and
| asking fairly specific things most of the time.
|
| But it's pretty obvious when it produces garbage. So
| you'd reject it there and then. At the very least code
| review will raise so many questions. How did 8000 lines
| make it into the code base?
| akavi wrote:
| I've never seen 8000 -> 40, but I have done ~10 kLoC ->
| ~600.
|
| Aggggressively "You can write Java in any language" style
| JavaScript (` _Factory`, `_ Strategy`, etc) plus a whole
| mini state machine framework that was replaceable with
| judicious use of iterators.
|
| (This was at Google, and I suspected it was a promo project
| gone metastatic.)
| amluto wrote:
| Every now and then, in between reasonable and almost-
| reasonable suggestions, Copilot will suggest a pile of code,
| stylistically consistent with the function I'm editing, the
| extends clear off the bottom of the page. I haven't been
| inspired to hit tab a couple times and try to reverse
| engineer the resulting vomit of code, but I can easily
| imagine a new programmer accepting the code because AI! or,
| perhaps worse, hitting tab without even noticing.
| uaas wrote:
| This is also true for human code, more often than not.
| bearjaws wrote:
| This is one of those stories that I am sure has happened, but
| when it comes to "and then they never asked him again le XD face"
| it's clearly just made up.
| Scuds wrote:
| management could have decided on a process change. Simple as
| that.
|
| I get the sentiment though, "He blew management's mind so much
| they made an exception for him".
|
| But, Folklore.org is a bit less onanistic than ESR's jargon
| file.
| pwndByDeath wrote:
| I've pulled stunts like this that makes management realize its
| easier to make an exception than to fight it
| sokoloff wrote:
| We had free soft drinks in the fridges at one place I worked.
| Cost-cutting measures were coming and I sent an email to all
| of engineering (including the VP) asking who wanted to join
| me in a shopping trip at 10AM to restock the fridge. In the
| email, I estimated that it would take between 60 and 90
| minutes. Two carfuls of engineers left at 10AM sharp and
| returned a little before noon and restocked the fridges.
|
| That was the first and last time we had to do it, as the soft
| drinks returned the following week.
| jonstewart wrote:
| Bill Atkinson recently died and there's a great HN discussion
| about him. He had a good relationship with Steve Jobs; it's
| reasonable to assume it's true that he got left alone,
| especially if Andy Hertzfeld is the person making the
| assertion.
| Scuds wrote:
| This being Lisa that's -2000 lines in 68k assembler. That's about
| as verbose as any real PL can ever get.
|
| For what it's worth, here's quicksort in 5 lines of haskell
| https://stackoverflow.com/questions/7717691/why-is-the-minim...
| qsort wrote:
| Not true quicksort though :)
|
| That's the problem with comparing lines of code: you're
| comparing apples and oranges. In this case you aren't even
| solving the same problem.
| Meneth wrote:
| NoScript link:
| https://www.folklore.org/Negative_2000_Lines_Of_Code.html
| xeonmc wrote:
| Thanks. @dang update URL?
| jfengel wrote:
| In college I worked for a company whose goal was to prove that
| their management techniques could get a bunch of freshman to
| write quality code.
|
| They couldn't. I would go find the code that caused a bug, fix it
| and discover that the bug was still there. Because previous
| students had, rather than add a parameter to a function, would
| make a copy and slightly modify it.
|
| I deleted about 3/4 of their code base (thousands of lines of
| Turbo Pascal) that fall.
|
| Bonus: the customer was the Department of Energy, and the program
| managed nuclear material inventory. Sleep tight.
| uticus wrote:
| > make a copy and slightly modify it
|
| In addition to not breaking existing code, also has added
| benefit of boosting personal contribution metrics in eyes of
| management. Oh and it's really easy to revert things - all I
| have to do is find the latest copy and delete it. It'll work
| great, promise.
| LAC-Tech wrote:
| This just depresses me. So many programmers back then spent time
| optimising algorithms. Now it's slop city.
| dang wrote:
| Related. Others?
|
| _Negative 2000 Lines of Code (1982)_ -
| https://news.ycombinator.com/item?id=33483165 - Nov 2022 (167
| comments)
|
| _-2000 Lines of Code_ -
| https://news.ycombinator.com/item?id=26387179 - March 2021 (256
| comments)
|
| _-2000 Lines of Code_ -
| https://news.ycombinator.com/item?id=10734815 - Dec 2015 (131
| comments)
|
| _-2000 lines of code_ -
| https://news.ycombinator.com/item?id=7516671 - April 2014 (139
| comments)
|
| _-2000 Lines Of Code_ -
| https://news.ycombinator.com/item?id=4040082 - May 2012 (34
| comments)
|
| _-2000 lines of code_ -
| https://news.ycombinator.com/item?id=1545452 - July 2010 (50
| comments)
|
| _-2000 Lines Of Code_ -
| https://news.ycombinator.com/item?id=1114223 - Feb 2010 (39
| comments)
|
| _-2000 Lines Of Code (metrics == bad) (1982)_ -
| https://news.ycombinator.com/item?id=1069066 - Jan 2010 (2
| comments)
|
| Note for anyone wondering: reposts are ok after a year or so
| (https://news.ycombinator.com/newsfaq.html).In addition to it
| being fun to revisit perennials sometimes (though not too often),
| this is also a way for newer cohorts to encounter the classics
| for the first time--an important function of this site!
| conartist6 wrote:
| I think of this story every time I see a statistic about how much
| LLMs have "increased the productivity" of a developer
| 6510 wrote:
| I often have a mental picture of the thing I need, I start
| writing it, get a bit "stuck" on architecture and think I could
| be using a ready made library for this. I find one or a few of
| them, look at the code (which is obviously more generic) and
| realize it's many times as large as I thought the entire project
| should be. With few exceptions the train of thought doesn't even
| reach the "Do I want to carry this around and baby sit it?"
| stage. Some how this continues to surprise me every time.
|
| These 5 lines are probably my favorite example.
|
| https://jsfiddle.net/gaby_de_wilde/c8bhcatj/7/
| bironran wrote:
| One of my best commits was removing about 60K lines of code, a
| whole "server" (it was early 2000's) with that had to hold all of
| its state in memory and replacing them with about 5k of logic
| that was lightweight enough to piggyback into another service and
| had no in-memory state at all. That was pure a algorithmic win -
| figuring out that a specific guided subgraph isomorphism where
| the target was a tree (directed, non cyclic graph with a single
| root) was possible by a single walk through the origin (general)
| directed bi-graph while emitting vertices and edges to the output
| graph (tree) and maintaining only a small in-process peek-able
| stack of steps taken from the root that can affect the current
| generation step (not necessarily just parent path).
|
| I still remember the behemoth of a commit that was "-60,000 (or
| similar) lines of code". Best commit I ever pushed.
|
| Those were fun times. Hadn't done anything algorithmically
| impressive since.
___________________________________________________________________
(page generated 2025-06-25 23:00 UTC)