Live data from Hacker News

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

news.ycombinator.com

231–240 of 294 posts

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

#231
post #210
post #175

Earlier quoted context omitted.

Ever heard of Timsort?

People were still finding bugs in common implementations of timsort as of 3 years ago. It's not unreasonable to stick with a somewhat more conservative choice for a core library function until there's more reason to have confidence in the implementations of timsort.

This comment got me looking into timsort bugs. This was a really interesting read: http://envisage-project.eu/proving-android-java-and-python-s...

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

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

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.

It's guaranteed to run in O(n log n) time. Currently it uses quicksort with heapsort as a fallback to prevent quicksort's quadratic worst-case time.

https://golang.org/src/sort/sort.go?s=5414:5439#L206

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

#234
post #210
post #175

Earlier quoted context omitted.

Ever heard of Timsort?

People were still finding bugs in common implementations of timsort as of 3 years ago. It's not unreasonable to stick with a somewhat more conservative choice for a core library function until there's more reason to have confidence in the implementations of timsort.

You know what, I'm not surprised at all.

Didn't one of the most simple algorithms, binary search, suffered of a bug in a standard library (was it Java?) a few years ago? If IIRC it was a corner case, I should check it because I don't recall the details, but it looked robust code.

Edit: I think it's this one https://ai.googleblog.com/2006/06/extra-extra-read-all-about...

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

#235

ARM mbed TLS [1], Amazon S2N [2], nginx [3] have a super consistent code style throughout and are prime examples of how C application programming should be done (in my opinion). [1] https://github.com/ARMmbed/mbedtls [2] https://github.com/awslabs/s2n [3] https://github.com/nginx/nginx

+1 for s2n. It's one of the select few C codebases that is actually a pleasure to read.

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

#236

Earlier quoted context omitted.

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…

Oh boy, I would give your comment an infinite number of up-votes. Yes, testing has reached fetish-like levels. Some of the test code I've encountered recently has been more voluminous, complex and has taken more man hours to develop and maintain than the application or library it's assigned to. For the love of God, develop the damned software! It's either going to work or it's not.

> has taken more man hours to develop and maintain than the application

But that is perfectly normal when developing quality code.

There is no rule that says that test code development should take LESS time.

Certainly different applications have different quality requirements. Perhaps the software you are developing doesn't have that high requirements?

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

#238
post #46

Twisted. Not only highly organized and sensibly delineated, but also a lot of fun to read - borderline comical at places.

How do you think the asyncio (formerly Tulip) sources compare?

asyncio is more modern, more stylish, and more concrete.

Twisted is more timeless, more patterned, and more self-aware.

I can imagine Twisted's asyncio reactor becoming its default (and the Twisted flow control slowly declining in importance), but Twisted's protocols, control structures, and execution models becoming more popular.

Twisted has undergone a great resurgence in quality engineering since asyncio became more viable - this was surprising to me, but is actually probably reasonably consistent with the way the historical influence of the standard library.

Overall, I think that Twisted is a great project; I almost always reach for it when my python codebase becomes mature enough to need more thoughtful abstractions around network I/O.

Post reply on HN