Live data from Hacker News

A project with a single 11,000-line code file

austinhenley.com

21–30 of 346 posts

Re: A project with a single 11,000-line code file

#21
post #17

It depends how you see it: I see a project that is quite successful since it's running in production for mission-critical needs and the code is solid enough that even non-programmers can do improvements to it

That's like running down the side of a very steep mountain and calling it a successful endeavor before you've reached the bottom

Re: A project with a single 11,000-line code file

#23

My company has REST client that is a single 9,000 line Go file that I have nightmares about. By my estimate it is really a ~300 line program written by someone who hated DRY.

More likely it was autogenerated from the API specs, if it hasn't been edited too much you might be the hero who made regenerating it part of the build.

Re: A project with a single 11,000-line code file

#25
post #23

My company has REST client that is a single 9,000 line Go file that I have nightmares about. By my estimate it is really a ~300 line program written by someone who hated DRY.

More likely it was autogenerated from the API specs, if it hasn't been edited too much you might be the hero who made regenerating it part of the build.

That was my first thought too, but if there's a generator for this it has been lost to time and retirements.

Re: A project with a single 11,000-line code file

#28
No doubt dozens of devs will throw in their own 10k LOC story here, and yes it's painful to watch so many people having professional cramps over it.

But don't forget society itself if governed by OOM larger bits of text with no referential integrity, no machine to tell you if it's inconsistent, and no way to test anything, other than making humans write more text to each other and occasionally show up in court. The law itself, even parts of it like the tax code, and regulations on various areas, are a melange of text and cultural understandings between lawyers, judges and government. We collect the data for this machine in the form of contracts and receipts, and it piles up in mountains.

As with code, it's not just legal professionals who have to deal with law. It spills into everyone's life, and there's nothing to do about it other than either guess what to do or pay a pro to tell you what to do.

Re: A project with a single 11,000-line code file

#29
The payroll check printer for my employer was once a couple thousand lines that generated raw PCL to be sent to a LaserJet that used magnetic toner to produce checks that had a working MICR number. It was rendered into spaghetti by multiple GOTOs that jumped to helpful labels like "666", and calls into other helper programs to generate more PCL that did things like change fonts and draw graphics. Of course none of it was commented, so you had to have a copy of the PCL spec on hand to know what any of it did. It was the product of a retired cowboy that had also written the rest of our custom payroll system over a number of years.

I attacked it by printing out and taping together each program into "scrolls" and tracing control flow with highlighters and sharpies. Had them all taped up on my office wall so I could refactor the whole thing from scratch, coworkers found that entertaining. Got a much more readable replacement working nicely. Then a couple years later HR bought a new system and we stopped printing our own checks. I was not sorry to see the whole thing go.

Post reply on HN