Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
21st century C
Klemens B., O’Reilly Media, Inc., Sebastopol, CA, 2013. 296 pp. Type: Book (978-1-449327-14-9)
Date Reviewed: Apr 26 2013

Whether you love C, hate C, or have no opinion, you cannot ignore C. A great deal of code is written in C. It is at the core of Unix and the Internet, and practically every computer now in use has a compiler for it. Many languages can link to it, and it is widely used to get close to the hardware. Although a number of newer languages are derived from it, C is likely to survive for the foreseeable future. Thankfully, recent updates have served to make it a much better language to work with. If C has a problem, it may have more to do with an outdated perception of what coding in C used to be like than what it can actually be like today. That is precisely one of the premises of this book, and the author aims to rectify the situation. The book is intended for programmers who know only a smattering of C or who learned the language from a more traditional textbook. I would add that it could also be useful for programmers who are not using the new features added to the language by the C99 and C11 updates.

Coding in modern C involves three components: creating an environment that includes tools for compilation, linking, testing, debugging, documentation, version control, and distribution; using modern C features and idioms; and using appropriate libraries. The author lays out his recommendations and explains in considerable detail how they can be put to work.

The book is organized into two parts: Part 1, “The Environment,” contains chapters 1 through 5, and Part 2, “The Language,” contains chapters 6 through 12. The book concludes with an epilogue, a glossary, a bibliography, and a 13-page index.

Three chapters are noteworthy. Chapter 5, “Playing Nice with Others,” describes the details of interfaces between Python and C. Chapter 11, “Object-Oriented Programming in C,” is best summarized by a quotation from page 200: “To develop control structures and build functions that make use of [object-oriented programming (OOP) features], C syntax easily provides the 10 percent of the edifice that creates 90 percent of the structure.” Chapter 12, “Libraries,” offers examples that use GLib, POSIX features of the standard C library (including Pthreads), the GNU Scientific Library, SQLite, libxml, and cURL.

I liked the author’s recommendations about setting up an environment. While recognizing that many people prefer to work within the comforting confines of an integrated development environment (IDE), the book recommends setting up a Unix-based environment (even allowing for the idiosyncrasies of a major player, Microsoft, who likes to do things its own way) to keep control of your own destiny. Some of the recommendations stand out, such as using make files rather than shell scripts, using Git for version control, using Doxygen and CWEB for documentation, and using autotools for code packaging and distribution.

In his review of C, the author covers a great deal of ground, though not every feature and nuance of the language. He has strong opinions, which he lays out in detail. Among the features he favors are macros with a variable number of arguments and structures with designated initializers. On the other hand, he considers functions with a variable number of inputs to be broken, and carefully explains their limitations and proper use. He explains how to avoid memory allocations. He also mentions features that should be considered obsolete or deprecated, and reviews pointers--for many, a treacherous, swampy bog--in detail so that they can be used effectively while avoiding needless and dangerous overuse.

This book exceeded my expectations. The writing is clear and upbeat, not ponderous or patronizing. While I did not agree with every word and every recommendation, I found plenty of material to consider and a lot more to learn than I anticipated. The author clearly knows his stuff and has carefully studied the language definition; his opinions matter. At times, I wished his examples were more extensive or his explanations more detailed. On the other hand, a couple of times, while conceding his point, I decided to ignore this or that recommendation. Occasionally, his sample code used one trick too many and would be clearer if it didn’t try to be quite so concise.

This book deserves very close scrutiny, ideally by running, modifying, or extending every example. Whether you are new to C or a longtime user, you will find plenty of opportunities to learn and to improve your knowledge of the language.

Reviewer:  Edgar R. Chavez Review #: CR141182 (1308-0663)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
C (D.3.2 ... )
 
 
General (D.1.0 )
 
Would you recommend this review?
yes
no
Other reviews under "C": Date
C (2nd ed.)
Schildt H., Osborne/McGraw-Hill, Berkeley, CA, 1990. Type: Book (9780078815386)
Jan 1 1992
C: a software engineering approach
Darnell P., Margolis P., Springer-Verlag New York, Inc., New York, NY, 1991. Type: Book (9780387973890)
Dec 1 1991
C for programmers
Ammeraal L., John Wiley & Sons, Inc., New York, NY, 1991. Type: Book (9780471928515)
Dec 1 1991
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy