News for hackers. Stuff that matters.

kevinmahaffey

Re:Ask HN: Examples of especially well-written C code? on Saturday September 11, 2010 @12:27PM (#1681752)
I love working with the redis codebase. In my opinion, redis is beautiful for a few reasons.

It's written in an object-oriented style (i.e. structs are "objects", each C file is a "class", and function prototypes are consistent for constuctors/destructors/instance methods). Also, everything is modular in redis (i.e. you can take the redis string or network library and use it in another project without any problems).

I also like the fact that it's portable C (C99 IIRC) that just requires make (no autoconfiguration necessary).