-2000 Lines of code
55 comments
·June 25, 2025bironran
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.
ddejohn
Sounds interesting. Have you written about it in more detail somewhere?
jfengel
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
> 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.
0cf8612b2e1e
I mean…when you have a pile of spaghetti, there is only so much you can do.
travisgriggs
Ask for more staff, reorganize the team into a set of multiple teams, and hire more middle management! Win win for the manager.
free_bip
I once had to deal with some contractors that habitually did this, when confronted on how this could lead to confusion they said "that's what Ctrl+F is for."
supportengineer
Was this in Blacksburg by any chance?
barbaracomell
[dead]
dang
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
I think of this story every time I see a statistic about how much LLMs have "increased the productivity" of a developer
1970-01-01
Including the cost to build and maintain new nuclear power plants takes developers' efficiency into absurdity.
Chris_Newton
Or the current industry favourite, “X% of our new code is now written by AI!”
abraxas
An old Dilbert cartoon had the pointy haired boss declare monetary rewards for every fixed bug in their product. Wally went back to his desk murmuring "today I'm going to code me a minivan!"
LordDragonfang
https://i.imgur.com/tyXXh1d.png
My manager has it pinned on the breakroom wall.
vodou
A long time ago I was working in a big project where the PLs came up with the most horrible metric I've ever seen. They made a big handwritten list, visible for the whole team, where they marked for each individual developer how many bugs they had fixed and how many bugs they had caused.
I couldn't believe my eyes. I was working in my own project beside this team with the list, so thankfully I was left out of the whole disaster.
A guy I knew wasn't that lucky. I saw how he suffered from this harmful list. Then I told him a story about the Danish film director Lars von Trier I recently had heard. von Trier was going to be chosen to appear in a "canon" list of important Danish artists that the goverment was responsible for. He then made a short film where he took the Danish flag (red with a white cross) and cut out the white lines and stitched it together again, forming a red communist flag. von Trier was immediately made persona non grata and removed from the "canon".
Later that day my friend approached the bugs caused/fixed list, cut out his own line, taped it together and put it on the wall again. I never forget how a PL came in the room later, stood and gazed at the list for a long time before he realized what had happened. "Did you do this?" he asked my friend. "Yes", he answered. "Why?", said the PL. "I don't want to be part of that list", he answered. The next day the list was gone.
A dear memory of successful subversion.
kunley
"Every line of code not written is a correct one".
One of the early Ruby Koans, IIRC, circulated on comp.lang.ruby around 2002
Scuds
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
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.
charcircuit
Just because lines of code is being reported it didn't mean that bigger automatically means better. It does tell a story about how one is spending their time though.
6510
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.
bearjaws
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.
jonstewart
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
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
I've pulled stunts like this that makes management realize its easier to make an exception than to fight it
sokoloff
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.
[delayed]