At one stage a company I worked for was considering licensing the code for a school time-tabling application, rather than paying the company to do the (fairly minor) changes we required to meet (non-USA) state requirements. The company was started by a couple of teachers, the same people who wrote their product. It was 10s of ks of Pascal code, but with not a single variable name or function name that made any sense;…
Ask HN: What's the largest amount of bad code you have ever seen work?
501–510 of 601 posts
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#502A customer-facing dashboard. Yes, a dashboard. How bad can a dashboard be bad you ask? Well, for one, the dashboard had tabs, and each tab was a separate webapp hosted on a separate server. And each team was responsible for developing and maintaining the webapp that their team was incharge of (i.e the User team in charge of Users webapp, Feature1 team incharge of Feature1 webapp). Now add on the fact that different t…
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#503Earlier quoted context omitted.
You've violated the terms of service of Oracle Database by insinuating the codebase quality is in any way not superior to any and all competitors. No benchmarks or comparisons may be performed on the Oracle Database Product under threat of grave bodily harm at the discretion of our very depraved CEO.
I doubt the competition (e.g. IBM or Microsoft) has any better code quality. Even PostgreSQL is 1.3M lines of code, so let's get something deliberately written for simplicity. SQLite is just 130k SLoC, so another order of magnitude simpler. And yet, even SQLite has an awful amount of test cases. https://www.sqlite.org/testing.html
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#504Earlier quoted context omitted.
I think TDD is the best way to develop (yet). Obviously tests are code, and if you write crappy highly-coupled tests you will end up with only much more messy code. This is a clear example of bad testing. The greatest advantage of TDD is in design, everything should be modular and easy to unit test, so you could: - reproduce bug and verify your bugfix in matter of ms with proper unit test - understand what code does…
A unit test is the least useful kind of test. It requires your design to be "easy to unit test" instead of simple, and if you change something and have to rewrite the test you might miss some logic in both pieces. Plus the tests never break on their own because they're modular, and each time you run a test that was obviously going to pass, you've wasted your time. As long as you have code coverage, better to have lot…
If you unit test properly you are unit testing the business logic, that you have to properly divide and write in a modular fashion. If you want to test a more complex scenario, just add initial conditions or behaviors. If you can't do that or don't know how to do that, then you don't know what your code is doing or your code is bad designed. And that may be the case we read above.
Tests rarely break because they help you not breaking the code and functionalities, and they are so fast and efficient on making you realizing that that you don't feel the pain of it.
I can't imagine any example where "easy to unit test" != simple
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#505Earlier quoted context omitted.
Yes, both. But maybe one is more important?
I'd argue the tests is more important for example Oracle is still the leading commercial DB, If your product works people will buy it.
Enterprise software sales cycles are slow, but once they start turning, it's hard to turn them back.
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#506Oracle 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?
#507Earlier quoted context omitted.
I'm confused by your comment. Your premise is that TDD should die, and your support is comparing it to a "great tool". Should TDD really die, or should people just stop treating things as a silver bullet? I personally love TDD, it helps me reason about my interfaces and reduces some of the more cumbersome parts of development. I don't expect everyone to use TDD and I don't use it all the time. Similarly I'd never tel…
The thing is, when I spend a lot of time thinking about how to make my program type-safe all of my unit tests become either useless or no-ops Integration tests easily survive refactoring, on the other hand
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#508A customer-facing dashboard. Yes, a dashboard. How bad can a dashboard be bad you ask? Well, for one, the dashboard had tabs, and each tab was a separate webapp hosted on a separate server. And each team was responsible for developing and maintaining the webapp that their team was incharge of (i.e the User team in charge of Users webapp, Feature1 team incharge of Feature1 webapp). Now add on the fact that different t…
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#509Earlier quoted context omitted.
I doubt the competition (e.g. IBM or Microsoft) has any better code quality. Even PostgreSQL is 1.3M lines of code, so let's get something deliberately written for simplicity. SQLite is just 130k SLoC, so another order of magnitude simpler. And yet, even SQLite has an awful amount of test cases. https://www.sqlite.org/testing.html
I guess that is just because SQL as a standard is not coherent nor something beatifully designed. SQL is mashup of vendor specific features all bashed togehter into one standard.
Re: Ask HN: What's the largest amount of bad code you have ever seen work?
#510Earlier quoted context omitted.
Code like this makes me think of the famous line from the film version of Hellraiser: "I have such sights to show you..." Contrast PostgreSQL or... uhh... virtually any other database. Oracle's mess is clearly a result of bad management, not a reflection of the intrinsic difficulty of the problem domain.
The KDB+ database has been around for 20 years. The executable is ~ 500kb. Enterprise software is gross.
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.