The C Programming Language is a bit of an anomaly among software programming books. It has maintained relevance over the course of more than 30 years. Yet it does so in a genre where many programming books become notably dated after a few years in print.
The text was originally published in 1978 by Brian Kernighan and Dennis Ritchie (K&R). The paperback featured here is based on the most recent 1988 edition. Despite periodic updates to the language by way of new standards such as ISO/IEC 9899:2018, the C Programming Language has stayed relevant to nearly anyone wanting to work in the language.
Structure
- Chapter 1 deals with basic features of C programming. This includes the basics of arithmetic expressions, loops, and so on. It also introduces the concept of variable scope.
- Chapter 2 deals with data types, their sizes, bitwise operations, and the languages’ order of operation (also called order of execution here)
- Chapter 3 is all about control structures like If-Else statements, loops, gotos and labels.
- Chapter 4 is about code reuse through functions (similar to methods or subroutines from other languages. This also revisits the idea of variable scope, plus static variables.
- Chapter 5 deals with pointers, indirection, and arrays
- Chapter 6 deals with structures
- Chapter 7 covers input and output streams; mostly the type relevant to consoles and serial consoles
- Chapter 8 covers the UNIX system interface, file descriptors, and dealing with the file system and its directory structure.
- Appendix A is effectively a language reference manual that covers common language keywords, operators, and concepts like scope in a concise manner.
- Appendix B covers the standard library: describing resources such as stdio.h, string.h, and other staples.
- Appendix C is a list of changes since the initial 1978 edition.
Throughout the book are several exercises aimed at testing the reader’s ability to apply what was learned. The solutions are provided in the 2nd edition of the 1988 book The C Answer Book by Clovis L. Tondo and Scott E. Gimpel [3].
Key Take-Aways
Because we cover a lot of embedded systems and related topics here, I should point out this is a great way for beginner and intermediate C programmers to understand the language in practical detail. Programming embedded devices like microcontrollers is a separate topic entirely; so one shouldn’t look just to this text as a guide for those areas.
Still, there is plenty an embedded developer can learn from this, even if its just for reference. Appendix A should probably be a starting point for anyone vaguely familiar with the language, but rusty in areas such as one’s complement, bitwise operations (including shifting and masking), and pointers. Effectively, this section was meant to summarize the C ANSI standard without the wordiness and legalistic prose of the standard itself.
Speaking of which, the concise English used throughout the book is one of its best properties. Each subject cut right to the chase. And at little over 260 pages in length, it’s one of the few technical reference books I would actually recommend reading end-to-end.
That said, I wouldn’t go so far as to say the book is beginner-friendly. And I would wager, it’s best for the reader to either have some experience with C itself or another procedural language.
In summary, the paperback featured here was in its 49th reprinting in spite of being published in 1988. The reason why becomes clear thanks to the book’s well-thought-out style and succinct way of explaining how to use the language effectively.
References
[1] | B. W. Kernighan and D. M. Ritchie, The C Programming Language, Upper Saddle River, New Jersey, USA: Prentice Hall, 1988. |
[2] | International Organization for Standardization, “ISO/IEC 9899:2018,” International Organization for Standardization, Information technology — Programming languages — C, June 2018. [Online]. Available: https://www.iso.org/standard/74528.html. [Accessed 1 Dec. 2019]. |
[3] | C. L. Tondo and S. E. Gimpel, The C Answer Book: Solutions to the Exercises in ‘The C Programming Language,’, Prentice Hall, 1988. |
Important Notice: This article and its contents (the “Information”) belong to Unboxing-tomorrow.com and Voxidyne Media LLC. No license is granted for the use of it other than for information purposes. No license of any intellectual property rights is granted. The Information is subject to change without notice. The Information supplied is believed to be accurate, but Voxidyne Media LLC assumes no responsibility for its accuracy or completeness, any error in or omission from it or for any use made of it. Liability for loss or damage resulting from any reliance on the Information or use of it (including liability resulting from negligence or where Voxidyne Media LLC was aware of the possibility of such loss or damage arising) is excluded.