Live data from Hacker News

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

news.ycombinator.com

331–340 of 601 posts

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

#331

At my first gig I teamed up with a guy responsible for a gigantic monolith written in Lua. Originally, the project started as a little script running in Nginx. Over the course of several years, it organically grew to epic proportions, by consuming and replacing every piece of software that it interfaced with - including Nginx. There were two ingredients in the recipe for disaster. The first is that Lua comes "batteri…

“This was the playground for the guy to create his own reality.”

Queue the Neil Gaiman sandman styled comic about his dark adventure

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

#332

I've worked on a CMS that was partially done in .NET, Iron Python and used an XSLT templating system to generate HTML for the front end. The architecture looked like something from the Early Java days. The system used Iron Python / C# in the following way. 1. A web request would hit the CMS 2. There was a massive switch statement to work out how the query would be rewritten 3. If it the url was prefixed with processo…

When you are just above the Ballmer peak.

We had a developer meeting a few weeks before he left the company and he said "I designed the system in the pub" ...

I like my beers but this guy was on another level.

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

#333

At my first gig I teamed up with a guy responsible for a gigantic monolith written in Lua. Originally, the project started as a little script running in Nginx. Over the course of several years, it organically grew to epic proportions, by consuming and replacing every piece of software that it interfaced with - including Nginx. There were two ingredients in the recipe for disaster. The first is that Lua comes "batteri…

I'm a masochist and would very much like to hear about the scheduler and time series database!

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

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

I think this validates my view that testing is important, but keeping the codebase clean, readable and modular is more important!

Why not both?

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

#335
post #168

I am maintaining one application in construction industry space. That application was created 25 years ago by construction worker that never wrote single line of code before, but because he caused a lot of problems on construction site they give him Programming 101 book and let him build it. 15 years later the app was close to half milion lines long of huge bowl of spaghetti code. Only comments in whole codebase were…

One of my first jobs in the industry was really similar. I ended up sitting down with a friend and rewriting it in C#. We didn’t have permission, but no one knew until our codebase was already in working shape (a month or so). We got away with it because the original codebase was so bad that it hadn’t shipped in 5 years. Months of 0 productivity were normal. My friend and I went on to rewrite the entire suite of products over the course of a year or two. We then started our own business. The rewrites were the most successful products that company had ever had in the modern era. Rewriting is not always a bad idea, and it can be less expensive in the medium run. Few seem to realize this, thanks to Joel Spolsky’s blog post on the matter being seen as dogma.

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

#337

At my first gig I teamed up with a guy responsible for a gigantic monolith written in Lua. Originally, the project started as a little script running in Nginx. Over the course of several years, it organically grew to epic proportions, by consuming and replacing every piece of software that it interfaced with - including Nginx. There were two ingredients in the recipe for disaster. The first is that Lua comes "batteri…

We've got a Robert Heinlein fan here...

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

#338

Earlier quoted context omitted.

Tests that run for 30 hours is an indication that nobody bothered writing unittests. If you need to run all tests after changing X, it means X is NOT tested. Instead you need to rely on integrations tests catching Xs behavior.

Always test "outside-in", i.e. integration tests first, then if you can afford it, unit tests. Integration tests test those things you're going to get paid for... features & use-cases. Having a huge library of unit tests freezes your design and hampers your ability to modify in the future.

While I see some value in the red-green unit testing approach, I've found the drawbacks to often eclipse the advantages, especially under real-world time constraints.

In my day to day programming, when I neglect writing tests, the regret is always about those that are on the side of integration testing. I'm okay with not testing individual functions or individual modules even. But the stuff that 'integrates' various modules/concerns is almost always worth writing tests for.

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

#339

At my first gig I teamed up with a guy responsible for a gigantic monolith written in Lua. Originally, the project started as a little script running in Nginx. Over the course of several years, it organically grew to epic proportions, by consuming and replacing every piece of software that it interfaced with - including Nginx. There were two ingredients in the recipe for disaster. The first is that Lua comes "batteri…

I've seen personal reality building happen in Lua several times already. It's very seductive to intelligent solo artists who are given a lot of freedom.

To be fair, I've also seen it happen in C, C++, and JavaScript.

Post reply on HN