Kirk Thomas is currently working for Knight-Ridder Financial Services as Software Development Team Leader. He has been programming embedded systems and network applications in C for eight years.
Comprehensive C, by David Spuler, attempts to serve a wide variety of programmers by dealing with as many C programming issues as possible. Spuler claims the book "will be useful to C programmers at all levels of experience," and will cover "all aspects of programming in ANSI C." By attempting to be so much to so many, the book fails to be truly useful in many areas.
Contents
The book is divided into two parts. Part 1, entitled "The C Language," includes 12 chapters on all of the topics one would expect: an introduction to C, variables, operators, control statements, functions, etc. In this part, the author places emphasis on touching on as many elements of C as possible for each of these topics. Coverage of each topic ranges from thorough (including an extensive example) to merely noting the presence of an element for completeness. The conceptual level of each topic ranges considerably as well. In the chapter on operators, paragraph one describes the basic arithmetic operators, but by paragraph three the discussion has already turned to implementation-specific issues of handling the MOD operator with negative numbers. Spuler notes in his introduction that he presumes fluency in another programming language, and this is absolutely true. However, the required fluency of other programming languages and programming issues in general ranges widely even between subsections of the same chapter.Perhaps the most unexpected chapter in Part 1 covers the preprocessor. For a programmer fluent in another language attempting to understand C, the preprocessor is likely to be one area that is relatively new. Spuler provides an excellent overview of the functionality of the preprocessor, providing explanations of replacement rules, macros, and conditional compilation constructs. As a very powerful and rather uncommon programming language element, it is easy for a programmer new to the C language to ignore the preprocessor as much as possible. Spuler not only brings the whole issue to the attention of the reader by giving it a separate chapter, but explains its functionality as well as generating an interest in exploiting its capabilities.
Part 2, entitled "Advanced Issues," includes chapters on a wide range of issues such as large programs, efficiency, debugging techniques, program style, portability, and more. Obviously, whole books have been written on each of these topics individually, so Spuler's coverage is intended more to whet the appetite of the reader on these issues than to be the definitive source of information. Each chapter includes a further reading section. Again, the coverage of these issues are over a wide range of programming skill and experience levels.
Although called "Advanced Issues," the examination of these issues is fairly elementary. The chapter on large programs mostly discusses how to declare variables and limit their scope, and what MAKE is and how to use it. The chapter on debugging techniques notes the existence of symbolic debuggers, briefly discusses the uses of LINT, and proceeds on through describing conditional debugging compilation, using cleverly placed printf statements, using redirected output, assertions, and signals. All of these topics have only a page or two devoted to them, so there isn't much that I would consider in-depth here. The chapter on efficiency actually wastes space describing the antiquated technique of unrolling loops. An embedded systems developer programming a four-bit micro might use this process, but in 1993, a typical new C programmer should not be spending his or her time learning a nearly obsolete technique with such highly specialized uses.
Finally, the book contains three appendices: "C for Pascal Programmers," "Common errors in C," and "Complicated Declarations." These appendices again bring the focal point of the book to teaching C to a programmer fluent in another language.
Commentary
My question about a book that covers so much ground is "Who really benefits from reading this book?" But the corallary question, "Who would be most disappointed reading this book?" is probably easier to answer. Programmers new to C and hoping to learn it will be quite frustrated if Comprehensive C is the first book they pick up, or is the text book in a C programming course. Programmers new to C might become confused reading Comprehensive C because the book mixes so many programming language issues that make C such a great language with the basic issues a new C programmer would want answered first. For example, a programmer reading about variable usage in C for the first time, might not understand the fundamental concept of variable promotion and how it is handled by the compiler in its relatively early presentation in Chapter 2. Spuler does not provide enough foundation in the preceding text to justify introducing such a key concept so early. Furthermore, a reader wanting a lot of specific code examples of how to perform basic programming tasks using C can find better examples in other introductory C texts.On the other hand, Comprehensive C does offer many marvelous insights into a wide range of C programming issues that many books basically ignore. A programmer at any level can find items of interest in this book, and will genuinely learn from them. Instead of using it as a reference book, C programs occasionally reread whole chapters to further strengthen their development.
Conclusion
By trying to cover so many topics relating to the C programming language, many of which have had whole books devoted to them individually, Comprehensive C manages to touch on a lot of areas without definitively investigating any of them. However, by having plenty of insightful comments and ideas on many of these topics, the book do es have something to offer. If you're looking for a book to teach you how to program in C, this book will probably frustrate you. If, on the other hand, you want to augment your current library, don't mind reading a lot to pick up some good pointers, or want a text book that fills in around a class curriculum, this book deserves a look.Title: Comprehensive C
Author: David Spuler
Publisher: Prentice-Hall
ISBN: 0-13-156514-1