
Ask HN: Examples of beautiful C code? - adbge
Hey, HN,<p>I hardly ever read other people's code, but I'd like to start dedicating a few hours each week to studying idiomatic C. The ultimate goal is to improve my own code.<p>What are some codebases that are worth studying? Bonus points for open-source projects that are looking for new contributors.
======
apaprocki
Since it was just posted, the xv6 ANSI C Unix source is nice and fairly
compact. They even provide a nice PDF for you to take it with you:

<http://pdos.csail.mit.edu/6.828/2011/xv6/xv6-rev6.pdf>

Also the low-level GLib core library is good:

<http://git.gnome.org/browse/glib/tree/glib>

------
herbivore
You should check out Redis - <https://github.com/antirez/redis>

------
tjholowaychuk
I'm certainly not the best C programmer out there but hey, might want to have
a look at:

\- <https://github.com/visionmedia/luna> \-
<https://github.com/visionmedia/libcss>

------
deutronium
You might be interested in [http://www.amazon.com/Beautiful-Code-Leading-
Programmers-Pra...](http://www.amazon.com/Beautiful-Code-Leading-Programmers-
Practice/dp/0596510047)

I believe one of the examples they gave in C was the diff algorithm from
Subversion.

------
infamouscow
The Quake 3 source code - <https://github.com/xxpor/Quake>

------
slig
* SQLite

------
ivysummer
linux kernel code is good enough for c examples.

------
davyjones
* Postgresql

* Varnish

------
naner
the netbsd kernel.

