Brian W. Kernighan, Dennis M. Ritchie. The C Programming Language. 2nd Edition. Upper Saddle River, NJ, USA: Prentice-Hall, Inc. 2014. ISBN 0-13-110362-8, 0-13-110370-9. GBP£33 / USD$52
“This book was typeset in Times New Roman and Courier by the authors, using an Autologic APS-5 phototypesetter and a DEC VAX 8550 running the 9th Edition of the UNIX operating system.”
This is the proclamation on the copyright page of ‘The C Programming Book’. It crosses my mind I am writing this review on a Mac running OS X, a distant child of the 9th Edition of UNIX thirty-seven years later.
In its fifty-second printing the book is a classic computer science text. It is so revered among computer scientists because the original creator of C, Dennis Ritchie, is one of the authors. ‘The C Programming Language’ aims to teach beginner’s the C programming language from scratch via a quick “Tutorial introduction” and a series of example programs exploring various facets of the language in increasing difficulty.
The second edition, and the most recent, was first printed in 1989 to include the various changes and additions after the American National Standards Institute (ANSI) and the International Organisation for Standardisation (ISO) created the C89/C90 standards, which for standardised the language for the first time. Despite being in its fifty-seventh printing, it hasn’t been updated in twenty-seven years, and as a result it is starting to show its age – if only in it use of language.
‘The C Programming Language’ is noticeably ‘stuffy’ and verbose. At times it approaches a technical manual to my modern eyes. However, if this is the only major weakness, it can be overlooked due to the books status and relevant content. Yet, despite my nostalgia and reverence for ‘The C Programming Language’ I would argue there are much better books to learn C.
When compared to modern texts such as ‘Learning C the Hard Way’, ‘The C Programming Language’ immediately looks wrinkled. This comparison is particularly apt as they each teach C in a similar way – through practical, increasingly difficult programming examples. In ‘Learn C the Hard Way’ succinct, lively, but professionally written chapters replace the verbose, stuffy language of ‘The C Programming Language’. In ’Learn C the Hard Way’ each chapter sets out a programming task centred around a language feature, each task builds a real-world program. While the authors of ‘The C Programming Language’, state “we have tried where possible to show useful programming techniques”, and “when forced to make a decision [on what to include], we have concentrated on the language”. This is not unreasonable, yet, ‘Learn C the Hard Way’ manages to create real-world “complete programs” and show off features of the language at the same time.
Regardless of the criticism of the language of ‘The C Programming Language’ is unsurpassed as a technical reference. And despite its stuffiness and verbosity it does a good job of guiding the reader through aspects of the language. The authors concentration on the language is clear, and the result is a perfectly usable, but inferior to modern texts, introduction to C.
The book starts with ‘Chapter 1: Tutorial Introduction’, a 34 page, fast-paced, practical introduction to the language which encourages readers to write “complete programs” using the major features of C. This format is useful to the reader because they have gained some practical knowledge, so when they read the detailed sections which deal with those features they are more likely to understand the explanation. The book assumes the reader already has some basic programming knowledge, of compilation and algebraic expressions.
Chapters 2 through 6 cover those features, and others, in greater detail. The chapters keep the focus on writing “complete programs”, as opposed to code snippets, which arguably leads to greater usefulness and comprehension for the reader. Chapter 7 describes the standard library, Chapter 8 deals with the interface between C programs and the UNIX operating system, and the final section, Appendix A, contains a reference manual.
’The C Programming Language’ is still a useful book to learn the C language, however let us not be held back by nostalgia and unmoving reverence. The book holds up surprisingly well for a twenty-seven-year-old revision of a thirty-seven-year-old book (its original printing). I argue if you are to buy only one book to learn C, don’t spend £33 on ‘The C Programming Language’. Consider ‘Learn C the Hard Way’, or another modern text. Have a look at some of the free PDF books which have gained popularity such as ‘Modern C’ from Prof. Jens Gustedt, a French academic and ISO expert in C.
‘The C Programming Language’ can have a place on your bookshelf, but only among other C programming books.