Practical C Programming

Introduction

It sounded like just the kind of book that I was looking for. I wanted a refresher on C since I’d not used it for a while, and some pointers on ‘advanced techniques.’ The blurb on the back looked about right and the fact that O’Reilly published it clinched the sale.

“Practical C Programming” not only plans to teach you C, but also about style, debugging and the software life-cycle.

Content

The book is split into three sections: Basics, Simple Programming and Advanced Programming.

‘Basics’ introduces the language, leaving out much of the fluff and complex bits, but including much on style and ‘process’ — designing, building and maintaining your program. This part of the tutorial is well structured, only introducing new features of the language as and when they are necessary. It does not teach you how to program, rather how to write C. Since you must be able to program before you start the book, I consider the pace to be much too slow. If you already know how to program, why should you have to wait until chapter six before introducing the if statement?

‘Simple Programming’ finishes off what the last section started. It adds most of the more complex bits such as scope, bitwise operators, pointers, floating-point numbers and the C Preprocessor. Of course, the boundary between basic and simple is not well defined, but I would consider the for statement to be basic. This section also includes information on optimising programs which you might have thought would fall under the ‘Advanced Programming’ section.

The final section is much more terse and reference-like than the first two sections. It includes topics such as the difference between ANSI and Kernigan and Ritchie C, more on pointers, portability and some of the more dodgy parts of C such as the 😕 operator and goto statement. It also includes a section on modular programming (again, I would consider this to be in the wrong section) and ‘Programming Adages.’ For the experienced programmer, it is probably this last chapter that is the most useful. Reminders such as avoid side-effects and never put an assignment inside a conditional seem to go against the grain of conventional C wisdom, but are, indeed, correct and very valuable.

Conclusion

‘Practical C Programming’ is not a bad book by any means. Scattered through its 400-odd pages are dozens of useful tips and heuristics, many of which I’ve not seen in print before. It also manages to clarify some oddities, and the example programs are mostly well thought-out and clear.

The C tutorial is not in enough detail to help a true novice and is too chatty and basic for some people, like myself, who just want the facts. The annoying part is that there is a lot of information in there that I didn’t already know, but I almost didn’t have the patience to read it.

It’s also unusual to find a chapter on software engineering in a C book. Oualline has a nice discussion of design, source control and configuration management but it does leave you wondering why it is there. Sure, it’s an important topic, but there are huge books dedicated to this subject. He can not (and does not) even begin to scratch the surface.

What the book lacks is a clear focus. Is the book for a novice programmer? Is it for someone that doesn’t know C? Someone that does know C? Is it a reference? A software engineering guide? The real answer is that it tries to do it all, but only partially succeeds. A nice try but not a must buy.

The facts

Author: Steve Oualline

Cost: Approximately ?24.50 or US$32.95

ISBN: 1-56592-306-5

Buy this book from Amazon.com of from Amazon.co.uk.