Live data from Hacker News

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

news.ycombinator.com

41–50 of 601 posts

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

#41
post #10

Years ago as an intern at Microsoft, I had code go into the Excel, PowerPoint, Word, Outlook, and shared Office code. Excel is an incomprehensible maze of #defines and macros, PowerPoint is a Golden Temple of overly-object-oriented insanity, and Word is just so old and brittle you'd expect it to turn to dust by committing. There are "don't touch this!"-like messages left near the main loop _since roughly 1990_. I had…

"Don't touch this" around the main loop can mean being able to make promises about responsiveness, reliability, etc.

Frequently there are critical code sections where it is much easier to tell people "don't touch it" rather than training people how to work on it safely.

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

#42
We have absolutely no idea how to write code. I always wonder if it's like this for other branches of engineering too? I wonder if engineers who designed my elevator or airplane had "ok it's very surprising that it's working, let's not touch this" moments. Or chemical engineers synthesize medicines in way nobody but a rockstar guru understands but everyone changes all the time. I wonder if my cellphone is made by machines designed in early 1990s because nobody was able to figure out what that one cog is doing.

Software is a mess. I've seen some freakishly smart people capable of solving very hard problems writing code that literally changes the world at this very moment. But the code itself is, well, a castle of shit. Why? Is it because our tools (programming languages, compilers etc) are still stone age technology? Is it because software is inherently a harder problem than say machines or chemical processes for the human brain? Is it because software engineers are less educated than other engineers? .....?

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

#43

From 10+ years ago when I worked at PayPay, webscr (the frontend at the time, where you'd log in) was a total of 2GB of C++ that would get compiled into a 1GB CGI executable, deployed over some ~700+ web servers. Debug versions would never get compiled, as I'm told the resulting file was too large for the filesystem to handle. Apparently a great deal of the code was actually inline XML. They knew this was a bad pile…

I think you meant to say PayPal?

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

#44

From 10+ years ago when I worked at PayPay, webscr (the frontend at the time, where you'd log in) was a total of 2GB of C++ that would get compiled into a 1GB CGI executable, deployed over some ~700+ web servers. Debug versions would never get compiled, as I'm told the resulting file was too large for the filesystem to handle. Apparently a great deal of the code was actually inline XML. They knew this was a bad pile…

Job security.

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

#45
Not exactly code but people would be scared if they found out how much of the Internet, at OSI layers 1, 2 and 3, is held together by the metaphorical equivalent of duct tape and twine. At OSI layer 1, sometimes almost literally. Major ISP outages that have been caused by somebody tripping over the $5 power strip that was powering the authoritative nameserver.

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

#46
An Angular app with ~50k LOC.

Barely any tests and several hand-rolled components, some of which were merged only because the author managed to implore somebody to give them an R+ after a few sprints of the branch just sitting there.

A total of 21 people were involved in creating this system and for some insane reason we still had daily standups with almost full attendance.

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

#47
ah my godness that brings back bad memories... :|

I was at a project were every new developer said "i have never seen such bad code". Srsly! 3 new People said it and me as well.

- Bad testability - no tests - hidden 3 bad bugs surfaced in just one year - ...

I had very little trust in that code. And it was not much fun. On Upside: Cleaning it up was a great feeling.

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

#48
post #10

Years ago as an intern at Microsoft, I had code go into the Excel, PowerPoint, Word, Outlook, and shared Office code. Excel is an incomprehensible maze of #defines and macros, PowerPoint is a Golden Temple of overly-object-oriented insanity, and Word is just so old and brittle you'd expect it to turn to dust by committing. There are "don't touch this!"-like messages left near the main loop _since roughly 1990_. I had…

"Don't touch this" around the main loop can mean being able to make promises about responsiveness, reliability, etc. Frequently there are critical code sections where it is much easier to tell people "don't touch it" rather than training people how to work on it safely.

When that is the case, would it not also be a really good place to explain why not, or provide a link to the place where such an explanation is provided?

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

#49
post #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!

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.

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

#50
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 someone who codes an ERP app built on 12.2 this comment resonated with me in ways you can't begin to imagine.
Post reply on HN