I'm primarily a c#/.NET programmer, but the hobby project that I am about to take on will involve coding in c.
I know that there is a ton of c code out there, but its very hard to separate a well structured c project from a badly structured project if you did not "grow up" with the language. Can anyone point me toward a newer, non trivial (but not enormous) project that is considered a good example of how to structure c code?
Edit
If you cannot find a project, feel free to discuss in words how you think a c project should be structured.
Modern C introduces you to modern day C programming, emphasizing the unique and new features of this powerful language. For new C coders, it starts with fundamentals like structure, grammar, compilation, and execution.
C exists everywhere in the modern world. A lot of applications, including Microsoft Windows, run on C. Even Python, one of the most popular languages, was built on C. Modern applications add new features implemented using high-level languages, but a lot of their existing functionalities use C.
It is used in developing an operating system. Operating systems such as Apple's OS X, Microsoft's Windows, and Symbian are developed using 'C' language. It is used for developing desktop as well as mobile phone's operating system. It is used for compiler production.
Dave Hanson's C Interfaces and Implementations is a very well-crafted library of about 7000 lines of code. The book is great if you can afford it.
The implementation of the Lua programming language and libraries is about 17,000 lines of C code and is very well done but quite sophisticated in places—compilers and garbage collectors are not so easy to understand without background in those fields. But the code is beautifully engineered.
Git is over 125,000 lines of code. I can't recommend that anyone study it as an example of how to engineer C code. Just the design and public interfaces, let alone the implementations, are hard to understand—which is why there are so many git tutorials.
Check out git source code: http://github.com/git/git/tree/master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With