TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Examples of beautiful C code?

17 pointsby adbgeover 13 years ago
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.

9 comments

apaprockiover 13 years ago
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:<p><a href="http://pdos.csail.mit.edu/6.828/2011/xv6/xv6-rev6.pdf" rel="nofollow">http://pdos.csail.mit.edu/6.828/2011/xv6/xv6-rev6.pdf</a><p>Also the low-level GLib core library is good:<p><a href="http://git.gnome.org/browse/glib/tree/glib" rel="nofollow">http://git.gnome.org/browse/glib/tree/glib</a>
herbivoreover 13 years ago
You should check out Redis - <a href="https://github.com/antirez/redis" rel="nofollow">https://github.com/antirez/redis</a>
tjholowaychukover 13 years ago
I'm certainly not the best C programmer out there but hey, might want to have a look at:<p>- <a href="https://github.com/visionmedia/luna" rel="nofollow">https://github.com/visionmedia/luna</a> - <a href="https://github.com/visionmedia/libcss" rel="nofollow">https://github.com/visionmedia/libcss</a>
deutroniumover 13 years ago
You might be interested in <a href="http://www.amazon.com/Beautiful-Code-Leading-Programmers-Practice/dp/0596510047" rel="nofollow">http://www.amazon.com/Beautiful-Code-Leading-Programmers-Pra...</a><p>I believe one of the examples they gave in C was the diff algorithm from Subversion.
infamouscowover 13 years ago
The Quake 3 source code - <a href="https://github.com/xxpor/Quake" rel="nofollow">https://github.com/xxpor/Quake</a>
sligover 13 years ago
* SQLite
ivysummerover 13 years ago
linux kernel code is good enough for c examples.
davyjonesover 13 years ago
* Postgresql<p>* Varnish
nanerover 13 years ago
the netbsd kernel.