Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C and modern practices/examples in Linux

Tags:

c

linux

I'm looking for programs/projects that are small to moderate size that show good modern practices for developing applications in C on Linux. I'd like to learn by example and curious how things are done out in the real world.

like image 763
Adam Flott Avatar asked Oct 21 '08 22:10

Adam Flott


2 Answers

The Art of Unix Programming

A great book that is simply a joy to read. Even if you aren't a *nix programmer or a C programmer, the examples and case studies are great.

like image 81
daharon Avatar answered Nov 15 '22 04:11

daharon


The XMMS2 codebase is fairly young and is a good example for coding style as well as techniques to use C in a modern, yet very clean (it has to build on a lot of platforms) fashion.

It includes a client-server model with cross-platform communication, an object oriented system inside the server, a sophisticated plugin system, threading to fullfill the realtime need of feeding the soundcard. The plugins also give good examples of incorporating third-party libraries. Complimented with an exported API for which also several language bindings are available (which shows you how to do it).

You will see many different modern day issues covered within the xmms2 code. The code base is very clean and comes with little "old code" here and there, which is still written well.

It also uses a sophisticated build system and the developers heavily rely on git's features. So there is even more to learn than just the plain code itself. The community is active and helpful on IRC, if you have any questions about the code.

http://xmms2.xmms.se

Drawback: It is not small. But it is relatively modular, especially with the server components being distinct objects, so you could pick a part of it which covers specific issues and learn from that. Or even try to write your own client, plugin, whatever.

like image 3
ypnos Avatar answered Nov 15 '22 04:11

ypnos