Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What are some specific examples of beautiful C code in your view? Asking for a friend.


After finding the documentation and guides for writing nginx modules woefully inadequate, I did a lot of poking around in the nginx internals to better understand how things worked.

The code is very readable, follows good style guidelines, and has its fair share of brilliant workings. I found that the source code served as much better documentation than a lot of _actual_ documentation that I've read.


You beat me to it! I was just about to suggest the nginx internals. :)


I like poking around FreeBSD's code, specifically some of the drivers and userland. I find a lot of code that rpaulo commits to be particularly clean and understandable. Some of rdivacky's work on boot2 and clangbsd is also inspiring to me.

http://svn.freebsd.org/base/user/rpaulo/


Plan 9 code is beautiful http://plan9.bell-labs.com/sources/plan9/sys/src/

Although there are a few extensions in its C compiler http://plan9.bell-labs.com/sys/doc/compiler.html


Lua, SQLite, the OpenBSD/FreeBSD userland utilities.


The Busybox project.


I'm glad. Somewhere on my mental "code I'd like to read list" is the busybox code, because I don't understand how it does so much with so little. If it does it and looks good, I'm doubly impressed. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: