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.
Ask HN: What open source project, in your opinion, has the highest code quality?
231–240 of 294 posts
Re: Ask HN: What open source project, in your opinion, has the highest code quality?
#232I 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.
Re: Ask HN: What open source project, in your opinion, has the highest code quality?
#233Re: Ask HN: What open source project, in your opinion, has the highest code quality?
#234Earlier 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.
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?
#235ARM 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
Re: Ask HN: What open source project, in your opinion, has the highest code quality?
#236Earlier 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.
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?
#237Re: Ask HN: What open source project, in your opinion, has the highest code quality?
#238Twisted. 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?
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.