TechBookReport logo



Keywords: C, programming, development

Title: 21st Century C

Author: Ben Klemens

Publisher: O'Reilly

ISBN: 978-1449327149

Media: Book/Kindle

Level: Some C experience required

Verdict: Good in places, but could be better

 

New books on C programming are few and far between, far fewer even than new books on Java these days. Still rarer is a book on C that does more than give you and tweak on Kernighan and Ritchie or a dummies guide to some basic syntax. Bob Klemens aims to do more than just give you some curly braces syntax and a run around pointers to pointers to poi… you get the picture. Instead Klemens sets out to show you, dear reader, that C is a viable programming language for general purpose coding, with all the conveniences that developers in other languages take for granted - you know, stuff like library management, automated build tools, integrated environments, decent libraries and so on.

The first thing to point out is that this is definitely not a book for the beginner. It's assumed that you already have a grasp of the syntax and a degree of familiarity with the 'classic' C development paradigm - you know how to write code, how to build a make file, how to compile and link etc. That said, it's not assumed that you're a C guru, so often new topics are introduced with a bit of revision and some reminders.

I fit the target demographic for sure. I started developing a long time ago, and my first languages were C, assembler and APL (yes, I know, extreme ends of the spectrum when it comes to abstraction). But in the years since then I've coded in just about everything, but have pretty much left C (and assembler and APL), behind. When I've had to code in C, it's because I needed something extra in Java and JNI was easy enough to use, but even that was half a decade ago. So, has the book rekindled a desire to code in C again?

To be honest, I almost turned away at the first hurdle. The first section of the book is all about setting up a modern programming environment. I was hoping that there'd be the lazy way into this - a chapter on Eclipse or Netbeans or some other modern and cross-platform environment. Nope, instead there are chapters on make files, auto-tools, shell scripts etc. If you haven't done this before it feels like it takes a lot of work before you can get to work. For those of us who want to delve occasionally, it feels like an awful lot of config to get right, so perhaps a chapter on the big IDEs would have been useful to us laggards.

The more interesting stuff, for this reader at least, comes around chapter six, when we start the section on the language itself with a reprise on pointers. Followed by chapters on syntax you can safely ignore, macros (and Klemens is big on this topic), text handling (including Unicode), structs and complex data structures and then, at chapter 11, we get a chapter on object oriented C. Yes, object oriented C, not Objective C, not C++, but plain old C. It's a very stripped down, highly constrained kind of object orientation, a million miles from Java, C++ and the rest, but the book does show you how to code data and functions together that moves a long way towards object orientation. For me at least this section of the book was where the action was, and it did rekindle that urge to open an editor and code in C all over again…

The final chapter of the book gives a quick run around a few recommended libraries, including GLib, POSIX, the GNU Scientific Library, SQLite and a couple more.

Overall the book promises a lot and doesn't always deliver. Make no mistake, the idea behind the book is great - there's a gap in the market for a thoroughly modern take on C development, but this isn't it. The writing can be entertaining at times, and some of the topics are handled well, but overall there was too much time spent on hand-crafting your development environment and not enough on the core topic of C itself.


Hit the 'back' key in your browser to return to subject index page

Return to home page

Contents © TechBookReport 2013. Published 05 February 2013