Live data from Hacker News

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

news.ycombinator.com

181–190 of 294 posts

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

#181

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.

Are you sure you aren't thinking of LaTeX?

TeX (plain TeX, not LaTeX) has phenomenally good logging and error messages IMO — everything you need is there, each error message comes in a “formal” and “informal” form and points you to exactly the place the error happened, and TeX lets you fix things on-the-fly without restarting the program. All this of course assumes you use TeX the way it is described in the manual (The TeXbook). The experience is opposite with LaTeX, so I find it worth giving up all the convenience of LaTeX just for the wonderful experience with TeX.

As for “the TeX language”, there is no such thing. As Knuth has said many times, TeX is designed for typesetting, not programming. Sure it has macros to save some typing, but if you're writing elaborate programs in it (as is nearly inevitable if you're using LaTeX) you're doing something wrong. Knuth said:

> When I put in the calculation of prime numbers into the TeX manual I was not thinking of this as the way to use TeX. I was thinking, “Oh, by the way, look at this: dogs can stand on their hind legs and TeX can calculate prime numbers.”

But of course LaTeX does every such thing imaginable :-)

More on TeX not being a programming language: https://cstheory.stackexchange.com/a/40282/115

On the TeX error experience: https://news.ycombinator.com/item?id=15734980

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

#182
Scikit Learn comes to mind - not just because I can dig into the source code and immediately know what's happening, but also for the stellar documentation that goes above and beyond telling your what the functions do.

For example their Cross Validation documentation is amazing:

http://scikit-learn.org/stable/modules/cross_validation.html...

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

#183
post #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.

Thanks for that! I love looking at historical game code.

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

#185
post #54

Earlier quoted context omitted.

Inversely, this is counteracted by the logic to not use Git: https://sqlite.org/whynotgit.html

But to be honest, this is mostly fair criticism. Not sure why they need some of those things, but if they need it, then it's fine.

It's explained in more depth here: https://fossil-scm.org/fossil/doc/trunk/www/fossil-v-git.wik...

Essentially, git is designed for the "bazaar" development model, while Fossil is designed for the "cathedral" one, which is what SQLite uses, being developed by just three guys working very closely together.

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

#186
post #2

Dolphin Emulator https://dolphin-emu.org/

We try to keep up, but the truth is that it's a 15 years old C++ codebase implementing some weird hardware in even weirder ways. We're far from where we'd want to be code quality wise -- close to no automating testing infrastructure, code is full of module-level globals, inconsistent conventions, etc.

How would you even test an emulator except manually? It seems like automated website testing, but even worse. I guess screenshots + scripted input?

That seems like it'd be terrible to try to get running reliably.

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

#187
post #54
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.

Inversely, this is counteracted by the logic to not use Git: https://sqlite.org/whynotgit.html

The most interesting thing (IMO) left out of this page is the fact that D. Richard Hipp is the author of Fossil. This has a particular smell factor to it, not sure if it is a good or bad smell.

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

#189
post #180

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…

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...

Yes, bad tests are bad. Yes, mocks are bad. Good tests, however, are good.

To expound on that, designing for testability allows you to sidestep the need for mocks almost entirely, and forces you into easier, more reliable and more consistent code. Then when you choose to test it, the tests are simple, straightforward and valuable.

Post reply on HN