Live data from Hacker News

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

news.ycombinator.com

581–590 of 601 posts

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

#581
I might have a slightly different record, if you count lines in a single source file...

One client wanted to hire me to continue developing his AutoCAD plugin written in AutoLisp (a cut down version of lisp for writing macros in AutoCAD). He had all his code in a single file which was around 63,000 lines long. (I calculated this as 504 meters of screen/paper top to bottom).

This was for a product that was in production, used commercially, and he'd been going for 15 years, adding bits as he went. There were loops hitting 300 lines, well over a hundred global variables, no consistency, and duplication like you wouldn't believe because he hadn't grasped the idea of moving code out to reusable subroutines.

I asked him what he did when his clients found a bug. The answer was "knuckle down for a few weeks".

I just couldn't believe that this was his daily work for 15 years, and he never thought to learn anything about programming other than what was immediately required to solve the problem in front of him...

Another unbelievable part of this, is that AutoCAD has an absolutely superb IDE built into it (i.e. it's fricking free!) which has features like the ability select & run code in current scope with minimal clicks which make for the fastest development environment I have ever played with, as in, you have no idea how much functionality you can churn out in a day. But he didn't like it, so he edited his code in....wait for it... WordPad! (That's a Windows built in Rich text editor where double clicking on an underscored_word only selects up to the underscore because it's not made for code, and that on its own makes it impossible to work with).

I tried to modify his code for several hours but had to stop myself because it was madness. So I told him the only way forward would be to rewrite everything from scratch after which point I could make it do anything he wanted. I reckoned it would only take 4 weeks to rebuild his 15 years of mess - partly because the IDE makes development so damn quick, and was even willing to do it on a fixed price, but he declined, which I think was utter madness.

The thing is, he had 15 high paying clients, and two other part time employees helping with other aspects of the business, and drove a brand new Audi A3, which means he probably holds a world record for highest ratio of money earned to quality of code written, at least in the CAD subcategory :-D

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

#582

The worst for me was a rescue project: a site for a US tech sector Public-private partnership. Nothing too complicated: recurring donations, paid events, a small members area. They had sent it to an Indian firm to build in Drupal 7 - not a lightweight system to begin with. I would like to say "cue the stereotypes for Indian developers" and we could all have a good laugh. But no. This is more like Heart of Darkness. T…

Holy crap. You already earned yourself an upvote for this sentence: > * Memory management. What's that? This site required 16 GIGABYTES as a PHP memory limit in order to load the front page for an anonymous user.

I'm tempted to log out and created 5 new accounts to upvote for each bullet point :-D

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

#584
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…

As I read this, I am vacationing in Hawaii for the first time. I can look out my window right now and see the island of Lanai. And that's what I'm doing as I'm read your post right now.

Reading a few sentences, looking out at Lanai. Reading a few more sentences, and looking back at Lanai...

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

#585
post #570

Earlier quoted context omitted.

This is an interesting comment, because I can't decide if you are sarcastic or making a deep insightful comment. Because I don't think the statement is true. LOC can go on forever, but it usually happens in things that aren't beautiful and abstract.

I was being sarcastic.

thanks for reply. you said it so earnestly that i couldn't tell!

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

#586
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…

大公司也不过如此!www.xttblog.com

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

#587

Earlier quoted context omitted.

The KDB+ database has been around for 20 years. The executable is ~ 500kb. Enterprise software is gross.

> The executable is ~ 500kb. So... is this good or bad? A Hello World in Go is on the order of 2 MB. That doesn't say anything about code bloat, it just says that Go prefers static over dynamic linking.

That 2 MB might be messier than you suggest. It seems like people close to the project spent time trying to clean it up:

https://github.com/golang/go/issues/6853

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

#588
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…

大公司也不过如此!www.xttblog.com

编程人就是苦命啊,面试造火箭 进去拧螺丝 还tm是锈了三十年的破螺丝

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

#589

Earlier quoted context omitted.

大公司也不过如此!www.xttblog.com

编程人就是苦命啊,面试造火箭 进去拧螺丝 还tm是锈了三十年的破螺丝

老哥在哪拧螺丝,带带我

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

#590
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…

Sounds like ASML, except that Oracle has automated tests. (ASML makes machines that make chips. They got something like 90% of the market. Intel, Samsung, TSMC etc are their customers) ASML has 1 machine available for testing, maybe 2. These are machines that are about to be shipped, but not totally done being assembled yet, but done enough to run software tests on. This is where changes to their 20 million lines of…

Makes you think of how exactly code_quality correlates with commercial success.
Post reply on HN