Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
C primer plus (6th ed.)
Prata S., Addison-Wesley Professional, Upper Saddle River, NJ, 2013. 1080 pp. Type: Book (978-0-321928-42-9)
Date Reviewed: Jun 18 2014

Every working programmer should be well acquainted with C because of its influence and reach. The sixth edition of C primer plus, updated to reflect the changes brought about by C11 (officially, ISO/IEC 9899:2011–Information technology–Programming languages–C), the latest international standard for C, is an excellent resource for obtaining an initial acquaintance with the language.

The book has many things going for it. The material is presented in stages: when a topic makes an initial appearance, it is explained at a basic level, by means of both a discussion and one or more coding examples. Many examples are short but complete programs, which can be run from the command line or from an integrated development environment. Programs are shown with sample input and output. The code, the input, and the output are then reviewed in detail, sometimes line by line.

Later on, after further material has been introduced, concepts are reviewed again at a greater level of detail, but still thoroughly and at a relaxed pace. This is an outstanding pedagogical tool, seldom matched by other introductory programming books.

Also noteworthy is the author’s use of English: it is clear and to the point, grammatically correct, and touched with a light undercoating of understated humor that occasionally breaks through to the surface. From beginning to end (except perhaps for the appendices), this book is very pleasant to read.

Clearly, Prata has paid a great deal of attention to C as it has changed from one standard to the next. He carefully identifies the features present in different standards, often giving advice on how to get around issues the reader might face due to compiler limitations. From time to time, he recommends that when facing a given situation, it is time to look for a more current compiler.

Prata also does an outstanding job of detailing the nuances of C. Again, this level of detail and clarity of explanation is hard to find in other books or online. Consequently, some programmers may want to have two copies of the book, one at the office and one at home.

The book has grown from previous editions. The sixth edition, printed entirely in black and shades of gray, has 1036 pages, plus 27 pages of introductory material: front cover, table of contents, and preface. The page layout is good, without excessive margins. I like the fact that an excellent book doesn’t need multicolor glitter or a gaudy layout to be effective.

The book contains 17 chapters and two appendices: “Getting Ready”; “Introducing C”; “Data and C”; “Character Strings and Formatted Input/Output”; “Operators, Expressions, and Statements”; “C Control Statements: Looping”; “C Control Statements: Branching and Jumps”; “Character Input/Output and Input Validation”; “Functions”; “Arrays and Pointers”; “Character Strings and String Functions”; “Storage Classes, Linkage, and Memory Management”; “File Input/Output”; “Structures and Other Data Forms”; “Bit Fiddling”; “The C Preprocessor and the C Library”; “Advanced Data Representation”; “Answers to the Review Questions”; and “Reference Section.” The book concludes with a 33-page index.

The book can be used either in the classroom or for self-study. Each chapter ends with a summary, review questions, and exercises. The exercises, some easy and some not so easy, are designed to enhance mastery of the material covered. The book does not cover advanced topics such as threads.

Appendix B, “Reference Section,” from pages 905 through 1004, contains a comprehensive summary of C.

As good as it is, the book is not perfect. C is well known as a fertile source for careless coding that leads to safety vulnerabilities that have been exploited at great cost to society. Programmers new to C need to be made aware of the danger, and must be provided with references so they can learn how to mitigate potential vulnerabilities in existing code and to prevent them in new code. This is a complex area, which, unfortunately, Prata does not address. On pages 453 to 455, in a section entitled “The Unfortunate gets() Function,” Prata, who believes that gets() has been unfairly singled out, acknowledges that C11 has dropped this function from the standard and has replaced it with gets_s(), a safer alternative. But Prata considers fgets() a better choice, and this is the function he uses instead of gets(). Prata does not mention other bounds-checking interface extensions to the C library that C11 makes optional but that are in fact provided by most compilers.

As I said, this is a complex issue, but it should be mentioned. So should the CERT C coding standard [1] and Secure coding in C and C++ (2nd ed.) [2], both outstanding sources for expert guidance and advice.

More reviews about this item: Amazon

Reviewer:  Edgar R. Chavez Review #: CR142415 (1409-0714)
1) CERT C Coding Standard. https://www.securecoding.cert.org/confluence/display/seccode/CERT+C+Coding+Standard (06/04/2014).
2) Seacord, R. C. Secure coding in C and C++ (2nd ed.). Addison-Wesley Professional, Upper Saddle River, NJ, 2013.
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