Comment by VMG
8 years ago
Great idea. What other code bases are there that lend themselves to this?
Some kind of curated genius.com for source code would be interesting.
8 years ago
Great idea. What other code bases are there that lend themselves to this?
Some kind of curated genius.com for source code would be interesting.
The Go standard library is very well written and depending on which parts you read you can learn about lots of things like file operations, HTTP, crypto, etc.
It's easy to read it all on the web, the docs are here: https://golang.org/pkg/ and clicking on a function name shows the source.
I totally agree with you. The Go standard library's is fun to read. I end up opening multiple tabs of different packages. Lots of fun.
Doom 3's source code is a pleasure to read, and this overview is very well done.
http://fabiensanglard.net/doom3/index.php
I've been diving into OpenCV recently. It's a very popular library and generally pretty readable (although the code can get quite messy because they use vectorisation a lot). Since it's about as close as we have to a standard, fast, vision library, it's interesting to see how stuff gets implemented.
There are loads of little things that could be improved, so it's also a nice codebase for contributing to.
In general I think you should pick something that you use every day. There's no point reading OpenBSD for the sake of reading OpenBSD, you'll get far more value out of something familiar.
For operating systems I would recommend xv6:
> https://pdos.csail.mit.edu/6.828/2016/xv6.html
With the caveat that xv6 is more artificial, it's a codebase for teaching not a living one.
In the past every two years a new version was released - so I would not call it "not living". By personal correspondence with one of the xv6 authors concerning a somewhat larger patch for xv6 (which he liked), he told me that they consider to release a new version in fall 2017, which would be one year after the previous release.
1 reply →
John Resig used Genius to annotate the jQuery source code. Seems to be broken now.
https://genius.it/johnresig.com/files/jquery-original.html
The D standard library's Algorithms and ranges are nice. Realistically, most production code for things people depend on is quite well done: e.g. LLVM is pretty easy to read.
Opposite of this: STL implementations come to mind.
Libc++ is quite readable. Libstdc++, not as much.
I've recently hit more than 5 stacked bugs in older version of libstdc++ on bionic libc...
I've heard good things about the sources for musl and lua, if you're interested in reading C
If you're into Python, the Flask source is just awesome. I've learned a lot from that code.
Reading through Python itself is quite interesting, there's actually a MOOC somewhere that does this (ie they hack with the interpreter in the lectures), but I can't remember what it's called unfortunately.
I've just put it on my list to read the Python source.
1 reply →
v7x86[1] has some phenomenal x86 assembly code by Robert Nordier.
[1] http://emma.nfshost.com/v7x86/index.html
http://programming.reddit.com/info/63hth/comments/