I replaced it with an 11-line template.
Ask HN: What's the largest amount of bad code you have ever seen work?
391–400 of 601 posts
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#392Ten years ago I was called in to remediate a new web application which had been subcontracted to an Indian development company. The PHP developers who'd put it together evidently didn't know about classes, and each page in the application was hundreds, sometimes thousands, of lines of spaghetti code, most containing the same duplicated (but subtly changed) blocks providing database connectivity etc. Security had not…
10 years ago PHP didn't have classes
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#393From 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?
#394Oracle 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…
There is a clear difference between code developed AND maintained in the US vs. code that was developed in India, or code developed in USA and given to Indian developers to manage support. Nothing against Indians, but Ive been around the block and there seems to be a lesser quality of code from that part of the world and companies justifyvit in cost savings.
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#395Here's a metaquestion: Is it possible for any codebase to NOT eventually (given enough time) become a crufty pile of garbage? I suspect (but have no real evidence... yet) that SOME of this spaghetti garbage is due to the traits of procedural, OOP, mutable languages. But this would then imply that things like functional-language codebases have much longer lifespans... and I don't have evidence for that... but I'm hopi…
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#396Earlier quoted context omitted.
ok but from reading a lot of the comments on HN it sounds like many posters here think that they do work with idiots.
Those idiots probably also think the same, though.
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#397Earlier quoted context omitted.
What's the problem with "hand-rolled components"? Isn't that pretty much the essence of building non-trivial frontend stuff? Or does this have some special meaning in the Angular world?
Not in the case of components which could easily be replaced with a well-tested and proven solution. Notable among the ones in this project was the date picker - there's a decent number of those available and yet somebody made the decision to hand-roll it. The result was a mess that for some reason had a 300 LOC service as a part of it. Needless to say minimal tests. It was a waste of man-days in a project that was a…
There's so many integration points (business logic, i18n/l10n, styling, keyboard navigation, accessibility, etc) that I think it's often easier to write your own. Hopefully now that most browsers support , we can just use that most of the time.
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#398Earlier quoted context omitted.
I beg to differ. Having to run the full test suite to catch significant errors is an indication that the software design isn't (very) modular, but it has nothing to do with unit tests. Unit tests do not replace service/integration/end to end tests, they only complement them - see the "test pyramid". I think it's important to point this out, because one of the biggest mistakes I'm seeing developers do these days is re…
(terminology nazi mode) "... is an indication that the software design isn't (very) decoupled ". You can be modular without being properly decoupled from the other modules.
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#399Oracle 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…
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#400Oracle 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…
The notion of tests that take 20 hours blows my mind. The notions of tests written in C that take 20 hours I can't even fathom.
At that point, for DB testing, I doubt it matters what language test are written in, it's going to be mostly about setting up and tearing down the environment over and over.