
Ask HN: Good C (not C++) code for reading/learning? - jgalvez
I'd like to polish up my C. Can you recommend some good open source projects which are good examples of coding style and organization in C?
======
silentbicycle
The source for Lua is pretty good (if a little dense at times), and you can
read it in-browser: <http://www.lua.org/source/5.1/>

There's a suggested roadmap for reading it, too:
[http://www.reddit.com/comments/63hth/ask_reddit_which_oss_co...](http://www.reddit.com/comments/63hth/ask_reddit_which_oss_codebases_out_there_are_so/c02pxbp)

It is written in _ruthlessly_ standard ANSI C (for maximum portability).

It will probably also complement your C -- it's intended to be a handy drop-in
scripting language to embed in C programs, though it's also a pretty cool
language on its own merits. They had an unwavering focus on keeping it clean
and very small for embedding, and they make some really interesting choices
along the way. It's sort of like a minimalistic Python; it gets a lot of power
out of using "tables" (rather like Python dictionaries or Perl hashes) as a
primary data type.

------
SwellJoe
SQLite is _always_ recommended in threads like this (of which, I will point
out, there have been several here and at reddit...you might like to search for
them). I haven't looked at it since very early releases, but I'm guessing
quality has gotten better over time, since it is more stable than ever and
faster than ever, and still astoundingly lightweight.

~~~
yourabi
Interesting

------
RobGR
This is probably more than you are looking for, but the fftw code (
www.fftw.org ) is a pretty amazingly designed piece of C code that does some
very advanced stuff. However, if you trying to get off to a good start, you
might want simplistic examples.

One thing I think helps you become a better programmer, is to read your own
code carefully a long time after you have written it.

------
xpaulbettsx
GNOME code and the Linux kernel are both pretty good examples - writing a
well-structured, small GTK+ app will do wonders for your C skills

------
rmk
How about the Linux Kernel? \- Well-documented. \- Always good to know. \-
Good, well-organised code. \- _Real-life_ C code.

------
bayareaguy
It's a little dated now but the Tcl/Tk source is very good. I'd also recommend
the FreeBSD source tree.

------
reginaldo
One piece of code I found particularly useful was the old tftp. It's small
enough yet very instructive.

------
dchest
Git?

