The C Programming Language (book)
From Wikipedia, the free encyclopedia
The C Programming Language (sometimes referred to as K&R) is a well-known computer science book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the language (as well as co-designed the Unix operating system with whose development the language was closely intertwined). The book was central to the development and popularization of the C programming language and is still widely read and used today. Because the book was co-authored by the original language designer, and because the first edition of the book served for many years as the de facto standard for the language, the book is regarded by many to be the authoritative reference on C.
Contents |
[edit] History
The first edition of the book, published in 1978, was the first widely available book on the C programming language, written by the language's creators. Written in conjunction with the language's early development at AT&T Bell Labs, the version of C described in this book is sometimes referred to as K&R C (after the book's authors), often to distinguish this early version from the later version of C standardized as ANSI C.[1]
In 1988 the second edition of the book was published, updated to cover the changes to the C programming language resulting from the new ANSI C standard, particularly with the inclusion of reference material on standard libraries. The second edition (and as of 2006, the most recent edition) of the book has since been translated into over 20 languages.
ANSI C, first standardized in 1988, has since undergone several revisions, the most recent of which is ISO/IEC 9899:1999 (also known as "C99"), adopted as an ANSI standard in March 2000. However, no new edition of The C Programming Language has yet been released to cover the more recent standards.
[edit] Influence
The C Programming Language has often been cited as a model for technical writing, due to the book's clear presentation and concise treatment. At a modest 272 pages (for the second edition), the book's coverage is nevertheless comprehensive, with few wasted words. Examples generally consist of complete programs of the type one is likely to encounter in daily usage of the language, with an emphasis on system programming. The technical details of C are balanced by the authors' observations on good programming practice, which are immediately illustrated with concrete, realistic examples. As the authors write in the preface to the second edition[2]:
- We have tried to retain the brevity of the first edition. C is not a big language, and it is not well served by a big book. We have improved the exposition of critical features, such as pointers, that are central to C programming. We have refined the original examples, and have added new examples in several chapters. For instance, the treatment of complicated declarations is augmented by programs that convert declarations into words and vice versa. As before, all examples have been tested directly from the text, which is in machine-readable form.
Before the advent of ANSI C, the first edition of the text served as the de facto standard of the language for writers of C compilers. With the standardization of ANSI C, the authors more consciously geared the second edition toward programmers rather than compiler writers; in the authors' own words (again in the preface to the second edition[2]):
- Appendix A, the reference manual, is not the standard, but our attempt to convey the essentials of the standard in a smaller space. It is meant for easy comprehension by programmers, but not as a definition for compiler writers—that role properly belongs to the standard itself. Appendix B is a summary of the facilities of the standard library. It too is meant for reference by programmers, not implementers. Appendix C is a concise summary of the changes from the original version.
The influence of The C Programming Language on programmers, a generation of which "cut their teeth" on C in universities and industry, has led many to accept the authors' programming style and conventions as recommended practice, if not normative practice. For example, the coding and formatting style of the programs presented in both editions of the book is often referred to as "K&R style" or the "One True Brace Style" and, significantly, became the coding style used by convention in the source code for the Unix and Linux kernels.
[edit] Notes
- ^ Kernighan, Brian W.; Dennis M. Ritchie (February 1978). The C Programming Language, 1st ed., Englewood Cliffs, NJ: Prentice Hall. ISBN 0-13-110163-3.
- ^ a b Kernighan, Brian W.; Dennis M. Ritchie (March 1988). The C Programming Language, 2nd ed., Englewood Cliffs, NJ: Prentice Hall. ISBN 0-13-110362-8.
[edit] External links
- The C Programming Language — Official Web site for the book at Bell Labs
- Brian Kernighan's home page at Bell Labs
- Dennis Ritchie's home page at Bell Labs