News for hackers. Stuff that matters.
Re:Ask HN: What's the largest amount of bad code you have ev... by forthy on Thursday November 15, 2018 @05:39AM (#18458275)
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 ev... by pgaddict on Thursday November 15, 2018 @10:49AM (#18460174)
I'm sure some of the difference (25M vs. 1.3M) can be attributed to code for Oracle features missing in PostgreSQL. But a significant part of it is due to careful development process mercilessly eliminating duplicate and unnecessary code as part of the regular PostgreSQL development cycle.

It's a bit heartbreaking at first (you spend hours/days/weeks working on something, and then a fellow hacker comes and cuts of the unnecessary pieces), but in the long run I'm grateful we do that.

Re:Ask HN: What's the largest amount of bad code you have ev... by troels on Friday November 16, 2018 @07:04AM (#18468172)
> It's a bit heartbreaking at first (you spend hours/days/weeks working on something, and then a fellow hacker comes and cuts of the unnecessary pieces), but in the long run I'm grateful we do that.

The single hardest thing about programming, I'd say.

Re:Ask HN: What's the largest amount of bad code you have ev... by ska on Wednesday November 28, 2018 @02:35PM (#18554876)
In many (most?) ways the best edits of code are the ones where you can get rid of lines.
Re:Ask HN: What's the largest amount of bad code you have ev... by jeltz on Thursday November 15, 2018 @08:57AM (#18459229)
PostgreSQL has a lot of code but most parts of the code base have pretty high quality code. The main exceptions are some contrib modules, but those are mostly isolated from the main code base.
Re:Ask HN: What's the largest amount of bad code you have ev... by p0nce on Thursday November 15, 2018 @08:54AM (#18459204)
It's because software LOC scales linerarly with the amount of man-months spent: a testament to the unique ability of our species to create beautiful, abstract designs that will stand the test of time.
Re:Ask HN: What's the largest amount of bad code you have ev... by Latteland on Thursday November 15, 2018 @06:21PM (#18464445)
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.
Re:Ask HN: What's the largest amount of bad code you have ev... by p0nce on Friday November 16, 2018 @11:05AM (#18469567)
I was being sarcastic.
Re:Ask HN: What's the largest amount of bad code you have ev... by Latteland on Sunday November 18, 2018 @01:22PM (#18481712)
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 ev... by Latteland on Thursday November 15, 2018 @06:19PM (#18464429)
Worked on sql server for 10+ years. MS SQL Server is way better than that. The sybase sql server code we started with and then rewrote was as bad as oracle.
Re:Ask HN: What's the largest amount of bad code you have ev... by karulont on Thursday November 15, 2018 @06:05AM (#18458374)
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 ev... by majewsky on Thursday November 15, 2018 @07:03AM (#18458571)
There's also a lot of essential complexity there. SQL provides, in essence, a generic interface for entering and analyzing data. Imagine the number of ways to structure and analyze data. Now square that number to get the number of two tests for how two basic features of the language interact with each other. And that's not even near full test coverage.
Re:Ask HN: What's the largest amount of bad code you have ev... by 9question1 on Thursday November 15, 2018 @09:48AM (#18459591)
Your point about essential complexity is absolutely correct, but your faux mathematical analysis is totally not a legit way to analyze the complexity of something or determine test coverage. I feel like as programmers we should be comfortable making sensible statements without making up shady pseudo-math to sound convincing.
Re:Ask HN: What's the largest amount of bad code you have ev... by majewsky on Thursday November 15, 2018 @10:46AM (#18460130)
It's abundantly clear that I'm not making a precise computation here. My argument is that tests don't scale linearly with the number of features because interactions between features need to be tested as well.