Live data from Hacker News

Ask HN: What's the largest amount of bad code you have ever seen work?

news.ycombinator.com

21–30 of 601 posts

Re: Ask HN: What's the largest amount of bad code you have ever seen work?

#21
As many experienced commenters below have already noted, nearly any piece of substantial, revenue-generating, long-lived code will ascend to a place full of dragons and mysticism. The more interesting debates revolve around:

1) How did it get that way, and what can we learn from that? 2) Is it inevitable that all software will end up like that? 3) How can an organization ever successfully sunset or move to a more maintainable system? Or should they even aspire to that?

Re: Ask HN: What's the largest amount of bad code you have ever seen work?

#22
I use to work on hospital lab software.

* It was over 20 years old by the time I started

* It was written in Fortran

* Variable names were single and double digits

* Each fortran program would run in isolation but had a shared memory process

* It was formally a terminal program but a weird Java frontend was created so everything looked like Windows GUI

* All program names were four letter acronyms

* All data was stored in fixed width binary "flat" files

* It previously was under CVS version control, but each install slowly drifted apart, so each site had it own unique features and bugs.

* I once had to move a significant feature from one install to another using only patch files generated from the work done on the original install.

Re: Ask HN: What's the largest amount of bad code you have ever seen work?

#23
post #9

I'm guessing by bad, you mean ugly. I'm fairly convinced there is no "good" code, or that it's such a minuscule subset that you'll never likely encounter it in your career. Every year I look back on last years stuff I've written, and I can find ten ways to clean things up. In my opinion, if it works, and provides the utility it was designed to bring, then it doesn't matter. If it makes money, then who really cares!

> In my opinion, if it works, and provides the utility it was designed to bring, then it doesn't matter. If it makes money, then who really cares! This makes sense. However, if the code 1) is hard to understand (according to the developers available) and change and 2) needs to be changed, it costs money. Eg, read about the expense banks are now incurring trying to maintain COBOL systems. Whether the code is "bad" is…

Sure, but you're acting under the premise that "if we just did it 'right' the first time, we wouldn't have this mess". What I'm saying is that only under very few circumstances does it ever workout that way. Particularly with long standing systems and their software. It just builds over years, nothing you can really do about it.

Re: Ask HN: What's the largest amount of bad code you have ever seen work?

#24
post #11

Microsoft Biztalk. By "work", I mean it didn't crash. It also didn't do anything useful.

If SAP is how Lucifer interacts with our world then Biztalk is how Cthulhu seeks to enter our world by contaminating the minds of innocents with its eldritch horrors.

Mind you, it may have got better than my experiences with it, which as you can probably guess weren't very positive.

Re: Ask HN: What's the largest amount of bad code you have ever seen work?

#27
post #18

Oracle Database 12.2. It is close to 25 million lines of C code. What an unimaginable horror! You can't change a single line of code in the product without breaking 1000s of existing tests. Generations of programmers have worked on that code under difficult deadlines and filled the code with all kinds of crap. Very complex pieces of logic, memory management, context switching, etc. are all held together with thousand…

At least there are tests!

Re: Ask HN: What's the largest amount of bad code you have ever seen work?

#28
My worst experience was with a PHP app (no framework), 60K LOC per file, 6 dimension arrays, variables and comments in 3 different languages, elseif statements spread over 2-3k LOC, no kind of separation of concerns (HTML mixed with php, db calls, etc).

It was a 3 months nightmare with an arrogant as fudge client/developer.

Re: Ask HN: What's the largest amount of bad code you have ever seen work?

#30
More than a million lines with a single file containing more than 100,000 lines of spaghetti code consisting of macros and badly indented C code in a single function! This powered the GUI for an entire generation of low cost phones (pre Android era).
Post reply on HN