Live data from Hacker News

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

news.ycombinator.com

171–180 of 294 posts

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

#171

Earlier quoted context omitted.

I'd agree, but only as far as aesthetics go. When you have to understand the time complexity and runtime characteristics of the standard library sorting algorithms, I think Go does a very bad job - the standard `sort.Sort(data sort.Interface)` will run poorly if the data is already mostly sorted. I expect these kinds of things to be documented properly.

I was pretty certain most libraries shuffle then quicksort. No need for documentation. Does go not do this?

Being pretty certain isn't the same as being certain. I really don't care what most libraries do as long as they document what exactly they have chosen to do. Go's `sort.Sort(data Interface)` definitely does not shuffle.

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

#172
post #158

Earlier quoted context omitted.

How is the coreutils true faster? I would expect the openbsd true to be the fastest, it doesn't need to spawn a subshell and it doesn't do more than the posix specification requires (afaik --help/--version should be ignored).

Experience shows it's faster. It's just weird, but it's like that. time { for i in $(seq 1 10000); do /path/to/true; done; }

What are you comparing against what there? Two C executables with the same compiler flags on the same OS?

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

#174
post #10

OpenBSD and Co. (OpenSSH, etc.) * https://cvsweb.openbsd.org/src/ * https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/ * https://www.libressl.org/ * https://cvsweb.openbsd.org/src/usr.sbin/ntpd/

There's a lot to admire in OpenBSD but sometimes the peripheral tools they deliver don't work well. The example I know best is OpenNTPD (last link in your comment). It has a bunch of problems, including relatively poor clock discipline compared to other NTP implementations. And it doesn't even try to handle leap seconds. That causes problems on the machine itself which may or may not matter to you, but it's catastrophic if that OpenNTPD serves time to other servers. Unfortunately there's a bunch of OpenNTPD servers in the NTP Pool actively providing bad time. Some details from the 2016 leap second: https://community.ntppool.org/t/leap-second-2017-status/59/1...

Again I mostly admire OpenBSD. But OpenNTPD is not the best example of their work.

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

#175

Earlier quoted context omitted.

I'd agree, but only as far as aesthetics go. When you have to understand the time complexity and runtime characteristics of the standard library sorting algorithms, I think Go does a very bad job - the standard `sort.Sort(data sort.Interface)` will run poorly if the data is already mostly sorted. I expect these kinds of things to be documented properly.

I was pretty certain most libraries shuffle then quicksort. No need for documentation. Does go not do this?

Ever heard of Timsort?

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

#176
post #39

Lua. It's has everything a good C project should have: small size, simple build system, portability by using the simplest constructs and not ifdefs, a clear and well define scope that none dares trespassing.

You can see a mirror of Lua here! https://github.com/lua/lua

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

#177
Does assembly count? Prince of Persia's source code (not really open source...): https://github.com/jmechner/Prince-of-Persia-Apple-II

One look at any of the assembly files and you can get a sense of how properly organized the source code is.

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

#178
post #146

Its older than some HN posters, but the GPLed DOOM source code was one I liked. The performance reached by the game was considered impossible until Carmack did show us otherwise. So I expected lots of ASM and weird hacks, especially as compiler optimization wasnt as good as it is today. Surprise, surprise, the thing was easy to read, easy to get going, easy to port, reasonablye documented . It has shown me what a goo…

These 666 forks can't be a coincidence, right?

it seems to be, judging by the fact that its now 667 forks

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

#179
post #38

I hold the source code of Go standard library & base distribution (i.e. compiler, etc.) in very high regard. Especially the standard library is, in my opinion, stunningly easy to read, explore and understand, while at the same time being well thought through, easy to use (great and astonishingly well documented APIs), of very good performance, and with huge amounts of (also well readable!) tests. The compiler (includ…

This is one of the great things about many Go libraries; the language is so simple its difficult to overcomplicate a Go project. This makes reading any Go source code, projects, libraries, the stdlib, a joy. The only times I've found Go libraries to be a PITA to read is when they get autogenerated from some other language (protobuf compilations, parts of the compiler that came from C, AWS/GoogleCloud/Azure libraries, etc), but that's to be expected in every language.

Kubernetes is another great example of a project that is so unbelievably complex in its function, it should be completely impenetrable to anyone who isn't a language expert. But, go check it out; its certainly complex and huge, but actually grokable.

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

#180
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…

Agreed on the testing fetish and usually they're not valuable. Uncle Bob wrote about this last year and its something I wish everyone would read https://blog.cleancoder.com/uncle-bob/2017/10/03/TestContrav...
Post reply on HN