The C Programming Language: Difference between revisions

Content deleted Content added
Reverting edit(s) by 172.109.203.205 (talk) to rev. 1203415369 by KnowledgeScribe1: Vandalism (UV 0.1.5)
See also: journals and magazines
 
(34 intermediate revisions by 29 users not shown)
Line 1:
{{shortShort description|Programming book writtenBook by Brian Kernighan and Dennis Ritchie}}
 
{{about|the textbook|the programming language covered in the book|C (programming language)}}
{{Use American English |date=June 2025}}
 
{{Use mdy dates |date=June 2025}}
{{Infobox book
| name = The C Programming Language
| image = The C Programming Language, First Edition Cover.svg
| caption = Cover of the first edition.
| author = {{ubli
|[[Brian Kernighan]]<br>
|[[Dennis Ritchie]]
}}
| illustrator =
| cover_artist =
Line 14 ⟶ 17:
| genre =
| publisher = [[Prentice Hall]]
| pub_date = 1978 (1st Edition) <br> 1988 (2nd Edition){{ubli
|{{timeline-event |date=1978 |event=first edition }}
|{{timeline-event |date=1988 |event=second edition }}
}}
| isbn = 9780131101630
| dewey =
Line 21 ⟶ 27:
}}
 
'''''The C Programming Language''''' (sometimes termed '''''K&R''''', after its authors' initials) is a [[computer programming]] book written by [[Brian Kernighan]] and [[Dennis Ritchie]], the latter of whom originally designed and implemented the [[C programming language]], as well as co-designed the [[Unix]] [[operating system]] with which development of the language was closely intertwined. The book was central to the development and popularization of C and is still widely read and used today{{when|date=April 2025}}. 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 was regarded by many to be the authoritative reference on C.<ref name="ward198308" /><ref>{{Cite book|url=https://books.google.com/books?id=4Mfe4sAMFUYC|title=C in a Nutshell|lastlast1=Prinz|firstfirst1=Peter|last2=Crawford|first2=Tony|date=2005-12-16|publisher=O'Reilly Media, Inc.|isbn=9780596550714|page=3|language=en}}</ref>
 
== History ==
C was created by [[Dennis Ritchie]] at [[Bell Labs]] in the early 1970s as an augmented version of [[Ken Thompson]]'s [[B (programming language)|B]].<ref>{{cite webQ |Q29392176 |last=Ritchie |first=Dennis M. |author-link=Dennis Ritchie |publication-date=1993b }}</ref>
|url=https://www.bell-labs.com/usr/dmr/www/chist.html
|last=Ritchie
|first=Dennis M.
|title=The Development of the C Language
|date=1993
|work=History of Programming Languages, 2nd Edition
|access-date=2018-11-11
}}</ref>
Another Bell Labs employee, [[Brian Kernighan]], had written the first C tutorial,<ref>{{cite web
|url=http://www.harmonyatwork.in/blog/2009/10/leap-in-and-try-things-brian-kernighan/
Line 46 ⟶ 44:
|archive-url=https://ghostarchive.org/varchive/youtube/20211221/de2Hsvxaf8M |archive-date=2021-12-21 |url-status=live|title='C' Programming Language: Brian Kernighan - Computerphile
|author=Computerphile
|website=[[YouTube]] |date=2015-08-18
|access-date=2018-11-11
}}{{cbignore}}</ref>
Kernighan would write most of the book's "expository" material, and Ritchie's reference manual became its appendices.
 
The first edition, published February 22, 1978, was the first widely available book on the C programming language. Its version of C is sometimes termed ''K&R C'' (after the book's authors), often to distinguish this early version from the later version of C standardized as ''[[ANSI C]]''.<ref name="k&r1e">{{cite bookQ |Q63565563 |last1= Kernighan |first1= Brian W. |authorauthor1-link1link= Brian Kernighan |last2= Ritchie |first2= Dennis M. |authorauthor2-link2link= Dennis Ritchie |title= The C Programming Language |edition= 1st |publisher= [[Prentice Hall]] |publication-date= February 1978 |___location= [[Englewood Cliffs, NJ]] |isbn= 0-13-110163-3 |url= https://archive.org/details/cprogramminglang00kern }}</ref>
 
In April 1988, the second [[Edition (book)|edition]] of the book was published, updated to cover the changes to the language resulting from the then-new ANSI C standard, particularly with the inclusion of reference material on [[C standard library|standard libraries]]. The second edition of the book (and {{as of|20232024|lc=true}}, the most recent) has since been translated into over 20 languages.<ref>{{Citecite web |url=https://www.cs.princeton.edu/~bwk/cbook.html |last=KeninghanKernighan |first=Brian W. |author-link=Brian Kernighan |title=The C Programming Language, Second Edition |website=PricetonPrinceton University |url=https://www.cs.princeton.edu/~bwk/cbook.html |access-date=18 February 2023}}</ref> In 2012, an eBook version of the second edition was published in ePub, Mobi, and PDF formats.<ref>{{Cite interview |url=https://www.informit.com/articles/article.aspx?p=1960359 |title=An Interview with Brian Kernighan on C and The C Programming Language |website=InformIT |last=Keninghan |first=Brian W. |interviewer=John Wait |date=1 October 2012}}</ref>
 
C was first standardized in 1989 (as ANSI X3.159-1989) and has since undergone several revisions. However, no new edition of ''The C Programming Language'' has been issued to cover the more recent standards.
Line 61 ⟶ 59:
 
== Influence ==
''The C Programming Language'' has often been cited as a model for [[technical writing]], with reviewers describing it as having clear presentation and concise treatment. Examples generally consist of complete programs of the type one is likely to encounter in daily use of the language, with an emphasis on [[system programming]]. Its authors saidwrote,
 
{{blockquote|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.|preface to the second edition<ref name="k&r2e">{{cite bookQ |Q63413168 |last1= Kernighan |first1= Brian W. |authorauthor1-link1link= Brian Kernighan |last2= Ritchie |first2= Dennis M. |authorauthor2-link2link= Dennis Ritchie |title= The C Programming Language |edition= 2nd |publisher= [[Prentice Hall]] |publication-date= March 1988 |___location= [[Englewood Cliffs, NJ]] |url= https://archive.org/details/cprogramminglang00bria |isbn= 0-13-110362-8 }}</ref>}}
[[File:Hello World Brian Kernighan 1974.jpg|thumb|"Hello, World!" program by Brian Kernighan (1978)]]
The book introduced the "[["Hello, World!" program|Hello, World!]]" program, which prints only the text "hello, world", as an illustration of a minimal working C program. Since then, many texts have followed that convention for introducing a programming language.
 
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 wrote the second edition for programmers rather than compiler writers, sayingwriting,
 
{{blockquote|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.|preface to the second edition<ref name="k&r2e" />}}
 
The influence of ''The C Programming Language'' on programmers, a generation of whom first worked with 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 "[[Indent style#K&R|K&R style|One True Brace Style]]" and became the coding style used by convention in the source code for the [[Unix]] and [[Linux]] [[kernel (operating system)|kernels]].
 
==See also==
* ''[[The C++ Programming Language]]''
* ''[[The Preparation of Programs for an Electronic Digital Computer]]''
* [[List of computer science journals]]
* [[List of software programming journals]]
* [[List of computer magazines]]
* [[List of computer books]]
 
== References ==
{{Reflist |30em}}
 
== External links ==
* [https://ia903407.us.archive.org/35/items/the-ansi-c-programming-language-by-brian-w.-kernighan-dennis-m.-ritchie.org/The%20ANSI%20C%20Programming%20Language%20by%20Brian%20W.%20Kernighan%2C%20Dennis%20M.%20Ritchie.pdf The C Programming Language], second edition ([https://archive.org/details/the-ansi-c-programming-language-by-brian-w.-kernighan-dennis-m.-ritchie.org/page/8/mode/2up item information] at the Internet Archive)
* [http://s3-us-west-2.amazonaws.com/belllabs-microsite-dritchie/cbook/index.html The C Programming Language] - Dennis Ritchie's page containing information regarding translations, errata, etc.
* {{Cite web|url=https://www.learnbix.com/cprogramming/learn-c|archive-url=https://web.archive.org/web/20170221011231/https://www.learnbix.com/cprogramming/learn-c|url-status=dead|archive-date=2017-02-21|title=C Programming|date=2004-06-13|website=Bell Labs Computing Sciences Research Center|access-date=17 January 2017}}. Another archived page: {{Cite web|url=http://s3-us-west-2.amazonaws.com/belllabs-microsite-dritchie/cbook/index.html|title=The C Programming Language|date=2016-02-04}}
* [https://www.cs.princeton.edu/~bwk/cbook.html The C Programming Language] - Brian Kernighan's page (containing mostly the same, slightly more up-to-date information)
* [https://clc-wiki.net/wiki/K%26R2_solutions Answers to The C Programming Language Exercises]
 
Line 96 ⟶ 99:
[[Category:C (programming language)|C Programming Language, The]]
[[Category:Collaborative non-fiction books]]
[[Category:Prentice Hall books]]