46

What small open source projects in C are interesting for learning good design?

The project should be:

  • Not too large (like the linux kernel)
  • Well documented
  • Perhaps still under active development

I've just started learning C, and while the language itself is not too difficult, i'm struggling how to design larger applications, so i thought checking out other open source projects would be a good starting point.

Thanks!

Sander Versluys
  • 72,737
  • 23
  • 84
  • 91
  • possible duplicate of [Learn C from Open Source code](http://stackoverflow.com/questions/144568/learn-c-from-open-source-code) – Greg Hewgill Jan 03 '11 at 10:48

6 Answers6

26

Redis (nosql db) is:

  • under active development
  • a manageable size
  • portable and robust
  • has no external dependancies
  • very well written, understandable code
a2800276
  • 3,272
  • 22
  • 33
19

In my opinion, good examples of moderately sized projects written in C are:

jmbr
  • 3,298
  • 23
  • 23
  • 1
    Thanks! Found someone visiting Kazlib in my Apache logs, with this question as the referrer. :) – Kaz Dec 22 '13 at 06:40
  • GNU Scientific Library, seems to be a quite good lib to learn, not only c, but also math & algorithm – Eric Jun 28 '14 at 16:08
3

Posix threads are a perfect example of good C design

Alexandre C.
  • 55,948
  • 11
  • 128
  • 197
2

I like gnucash: http://www.gnucash.org/

No too large like Linux kernel, but still big I think.

bcsanches
  • 2,362
  • 21
  • 32
1

You can start learning from small and well structured applications like http://abygaelle.guillaume-fr.net/trac/gemmes

Nicolas
  • 81
  • 1
  • 3
1

It all depends what kind of projects you are interested in. And what aspect of it (specific algorithms, UI, networking, etc, etc...)

Head over to freshmeat, sourceforge or ohloh and browse the projects for your area of interest.

Alternatively if you want to look at projects that were chosen for a particular reason google summer of code might be interesting for you - even though these rarely include full projects.

EDIT: Also alternatively, you might take something like linux kernel, but instead of trying to understand everything try to

  • get the big picture
  • then concentrate on one tiny piece of it and inspect how the code changed over time (and for what reasons - it should be quite well documented)
Unreason
  • 12,556
  • 2
  • 34
  • 50