C Traps and Pitfalls

Last updated • 1 min readFrom Wikipedia, The Free Encyclopedia
C Traps and Pitfalls
C Traps and Pitfalls.jpg
Author Andrew Koenig
CountryUnited States
LanguageEnglish
GenreNon-fiction
Publisher Addison-Wesley
Publication date
January 11, 1989
Media typePrint (hardcover)
ISBN 0-201-17928-8

C Traps and Pitfalls is a slim computer programming book by former AT&T Corporation researcher and programmer Andrew Koenig, its first edition still in print in 2017, which outlines the many ways in which beginners and even sometimes quite experienced C programmers can write poor, malfunctioning and dangerous source code.

It evolved from an earlier technical report, by the same name, published internally at Bell Labs. [1] This, in turn was inspired by a prior paper given by Koenig on "PL/I Traps and Pitfalls" at a SHARE conference in 1977. Koenig wrote that this title was inspired by a 1968 science fiction anthology by Robert Sheckley, "The People Trap and other Pitfalls, Snares, Devices and Delusions, as Well as Two Sniggles and a Contrivance". [2]

Related Research Articles

<span class="mw-page-title-main">Dennis Ritchie</span> American computer scientist, co-creator of the Unix operating system

Dennis MacAlistair Ritchie was an American computer scientist. He is most well-known for creating the C programming language and, with long-time colleague Ken Thompson, the Unix operating system and B programming language. Ritchie and Thompson were awarded the Turing Award from the ACM in 1983, the Hamming Medal from the IEEE in 1990 and the National Medal of Technology from President Bill Clinton in 1999. Ritchie was the head of Lucent Technologies System Software Research Department when he retired in 2007. He was the "R" in K&R C, and commonly known by his username dmr.

ed (text editor) Line-oriented text editor for Unix

ed is a line editor for Unix and Unix-like operating systems. It was one of the first parts of the Unix operating system that was developed, in August 1969. It remains part of the POSIX and Open Group standards for Unix-based operating systems, alongside the more sophisticated full-screen editor vi.

<span class="mw-page-title-main">Pitcher plant</span> Carnivorous plant

Pitcher plants are several different carnivorous plants which have modified leaves known as pitfall traps—a prey-trapping mechanism featuring a deep cavity filled with digestive liquid. The traps of what are considered to be "true" pitcher plants are formed by specialized leaves. The plants attract and drown their prey with nectar.

In software development, Make is a build automation tool that automatically builds executable programs and libraries from source code by reading files called Makefiles which specify how to derive the target program. Though integrated development environments and language-specific compiler features can also be used to manage a build process, Make remains widely used, especially in Unix and Unix-like operating systems.

An anti-pattern in software engineering, project management, and business processes is a common response to a recurring problem that is usually ineffective and risks being highly counterproductive. The term, coined in 1995 by computer programmer Andrew Koenig, was inspired by the book Design Patterns and first published in his article in the Journal of Object-Oriented Programming. A further paper in 1996 presented by Michael Ackroyd at the Object World West Conference also documented anti-patterns.

<span class="mw-page-title-main">Walter Koenig</span> American actor and screenwriter (born 1936)

Walter Marvin Koenig is an American actor and screenwriter. He began acting professionally in the mid 1960s and quickly rose to prominence for his supporting role as Ensign Pavel Chekov in Star Trek: The Original Series (1967–1969). He went on to reprise this role in all six original-cast Star Trek films. He has also acted in several other series and films including Goodbye, Raggedy Ann (1971), The Questor Tapes (1974), and Babylon 5 (1993). In addition to his acting career, Koenig has made a career in writing as well and is known for working on Land of the Lost (1974), Family (1976), What Really Happened to the Class of '65? (1977) and The Powers of Matthew Star (1982).

<span class="mw-page-title-main">Version 7 Unix</span> 7th Edition of Research Unix alias UNIX Time-Sharing System

Version 7 Unix, also called Seventh Edition Unix, Version 7 or just V7, was an important early release of the Unix operating system. V7, released in 1979, was the last Bell Laboratories release to see widespread distribution before the commercialization of Unix by AT&T Corporation in the early 1980s. V7 was originally developed for Digital Equipment Corporation's PDP-11 minicomputers and was later ported to other platforms.

<i>The C Programming Language</i> Programming book written by Brian Kernighan and Dennis Ritchie

The C Programming Language is a computer programming 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 which development of 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 was regarded by many to be the authoritative reference on C.

A memory debugger is a debugger for finding software memory problems such as memory leaks and buffer overflows. These are due to bugs related to the allocation and deallocation of dynamic memory. Programs written in languages that have garbage collection, such as managed code, might also need memory debuggers, e.g. for memory leaks due to "living" references in collections.

<span class="mw-page-title-main">David Crane (programmer)</span> American video game designer and programmer

David Patrick Crane is an American video game designer and programmer.

In programming, a gotcha is a valid construct in a system, program or programming language that works as documented but is counter-intuitive and almost invites mistakes because it is both easy to invoke and unexpected or unreasonable in its outcome.

<span class="mw-page-title-main">Alexander Stepanov</span> Russian-American computer programmer (born 1950)

Alexander Alexandrovich Stepanov is a Russian-American computer programmer, best known as an advocate of generic programming and as the primary designer and implementer of the C++ Standard Template Library, which he started to develop around 1992 while employed at HP Labs. He had earlier been working for Bell Labs close to Andrew Koenig and tried to convince Bjarne Stroustrup to introduce something like Ada generics in C++. He is credited with the notion of concept.

<i>The Unix Programming Environment</i>

The Unix Programming Environment, first published in 1984 by Prentice Hall, is a book written by Brian W. Kernighan and Rob Pike, both of Bell Labs and considered an important and early document of the Unix operating system.

Andrew Richard Koenig is a former AT&T and Bell Labs researcher and programmer. He is the author of C Traps and Pitfalls and co-author of Accelerated C++ and Ruminations on C++, and his name is associated with argument-dependent name lookup, also known as "Koenig lookup", though he is not its inventor. He served as the Project Editor of the ISO/ANSI standards committee for C++, and has authored over 150 papers on C++.

Andrew Glaister is a video game programmer.

<span class="mw-page-title-main">Pitfall trap</span>

A pitfall trap is a trapping pit for small animals, such as insects, amphibians and reptiles. Pitfall traps are a sampling technique, mainly used for ecology studies and ecologic pest control. Animals that enter a pitfall trap are unable to escape. This is a form of passive collection, as opposed to active collection where the collector catches each animal. Active collection may be difficult or time-consuming, especially in habitats where it is hard to see the animals such as thick grass.

In the C++ programming language, decltype is a keyword used to query the type of an expression. Introduced in C++11, its primary intended use is in generic programming, where it is often difficult, or even impossible, to express types that depend on template parameters.

<i>Racing the Beam</i>

Racing the Beam: The Atari Video Computer System is a book by Ian Bogost and Nick Montfort describing the history and technical challenges of programming for the Atari 2600 video game console.

The following outline is provided as an overview of and topical guide to C++:

Cyatta is a genus of ant in the subfamily Myrmicinae containing the single species Cyatta abscondita. It is considered the most recent ancestor of all fungus-farming ants and a living fossil.

References

  1. Koenig, Andrew R., "C Traps and Pitfalls", Bell Telephone Laboratories, Murray Hill, New Jersey, Technical Memorandum.
  2. Cf. Koenig, preface to "C Traps and Pitfalls" book.