Live data from Hacker News

Ask HN: What open source project, in your opinion, has the highest code quality?

news.ycombinator.com

131–140 of 294 posts

Re: Ask HN: What open source project, in your opinion, has the highest code quality?

#131
post #40

SQLite. and for this reason alone! https://www.sqlite.org/testing.html As of version 3.23.0 (2018-04-02), the SQLite library consists of approximately 128.9 KSLOC of C code. (KSLOC means thousands of "Source Lines Of Code" or, in other words, lines of code excluding blank lines and comments.) By comparison, the project has 711 times as much test code and test scripts - 91772.0 KSLOC.

A better comparison would be some sort of defect rate. Does SQLLite manage less defects per line of code per month (or whatever) than PostgreSQL with that test suite?

Is there a distinction between the best codebase and the best test suite? Probably.

Re: Ask HN: What open source project, in your opinion, has the highest code quality?

#132

This is not necessarily about the code, but I've been really impressed for a while by the lodash project and its maintainer's dedication to constantly keep the number of open issues at 0. Any issues get dealt with at record speed, it's quite a sight to see. https://github.com/lodash/lodash/issues

Not necessarily relevant, but 15% of the issues are labeled "wontfix".

Re: Ask HN: What open source project, in your opinion, has the highest code quality?

#134
post #40

SQLite. and for this reason alone! https://www.sqlite.org/testing.html As of version 3.23.0 (2018-04-02), the SQLite library consists of approximately 128.9 KSLOC of C code. (KSLOC means thousands of "Source Lines Of Code" or, in other words, lines of code excluding blank lines and comments.) By comparison, the project has 711 times as much test code and test scripts - 91772.0 KSLOC.

Automated testing is useful and good. But I really feel it's reached a lever of fetishisation that is quite concerning.

Testing code is code which needs to be written, read, maintained, refactored. Very often nowadays I have to wade through tests which test nothing useful, except syntax. Even worse, with developers who adopt the mock-everything approach, I often find tests which only verify that the implementation is exactly the one they wrote, which is even worse: it makes refactoring a pain, because, even if you rewrote a method in a better way which produces exactly the results you wanted, the test will fail.

So, the ratio of testing code vs implementation code is a completely wrong proxy for code quality.

EDIT: I'm not criticising SQLite and their code quality - which I never studie - but the idea that you can judge code quality for a project just by the ratio of test code vs implementation code.

Re: Ask HN: What open source project, in your opinion, has the highest code quality?

#136
post #122
post #89

Earlier quoted context omitted.

So you measure good code by the number of test lines?

No but it could be a good proxy.

It's like code coverage, though. Zero might indicate a problem, but lots doesn't necessarily mean "good".

Re: Ask HN: What open source project, in your opinion, has the highest code quality?

#137

This is not necessarily about the code, but I've been really impressed for a while by the lodash project and its maintainer's dedication to constantly keep the number of open issues at 0. Any issues get dealt with at record speed, it's quite a sight to see. https://github.com/lodash/lodash/issues

Not necessarily relevant, but 15% of the issues are labeled "wontfix".

With such a big project, being quick to hand out wontfix isn't necessarily a bad thing. To be honest, seeing as this project is used by a huge part of the… rather diverse JS crowd, 15% wontfix is astoundingly low.

Re: Ask HN: What open source project, in your opinion, has the highest code quality?

#138

Knuth did a good job on TeX, and it has been closely examined for many years since so there are very few bugs.

The TeX language itself, and the logs and error messages of TeX are so bad, that I would hardly believe it.

Re: Ask HN: What open source project, in your opinion, has the highest code quality?

#139

LLVM and associated projects such as clang. Bazel is good too. OkHttp and Retrofit by Square.

I've been working with LLVM for a few years and I still find the code difficult to navigate and badly documented. And every single function's argument list is a random jumble of pointers and references (almost all arguments should be references, but many aren't).
Post reply on HN