
C Traps and Pitfalls
Andrew Koenig · 1989
Programming and computer science › C and C++
#1,628 most recommended
Hacker News
37
mentions by 24 people · top 9% of 15,732 books
Open Library
5.00★★★★★★★★★★
1 rating · 4 want to read
Wikipedia
151
article views a month
About the book
C Traps and Pitfalls is a short catalogue of mistakes that C programmers make, including experienced ones, and of the reasons those mistakes compile and run without complaint. It covers lexical, syntactic, and semantic pitfalls, along with linking and library problems, preprocessor misuse, and portability issues. It assumes the reader already knows the language from K&R. The central claim is that many C errors are not obscure. They follow predictably from specific features of the language, such as operator precedence, the handling of assignment within conditions, array and pointer equivalence, and the permissive rules for declarations and the preprocessor. The book holds that such errors are easy to avoid once they are recognized, so defensive programming depends on learning the specific traps. It makes this case mainly through concrete examples drawn from real programs, not through general rules of style.
Written by Claude from what it knows of this book.
What Hacker News says 79% recommend · 4% critical
In the commenters’ own words
It's interesting to see the range of proposed solutions to this issue. Here's a few from memory. Koenig's C Traps and Pitfalls does the opposite of what you'd…
> But when they bemoan using C they seem to misunderstand exactly how big a leap forward C was from pure assembly programming. Just having portable code in…
What Open Library readers say 5.00 from 1 rating
- 51
- 40
- 30
- 20
- 10
- 4 want to read
- 0 reading
- 2 have read
Only 1 rating: treat the average as a hint.
What Wikipedia says
- published January 11, 1989
- 151 views a month
Reddit communities — coming later
The threads it came up in
- Ask HN: What books changed the way you think about almost everything?
- Ask HN: I'm looking for a good book on the fundamentals of CS
- Ask HN: What books had the greatest effect on how you structure your code?
- Recommended Reading List for Developers [pdf]
- Ask HN: I use and love Python. What's the best book to learn C ?
Details
- First published
- 1989
- ISBN
- 9780201179286
- Editions known
- 2 at Open Library
- Open Library
- OL17755903W
C (Computer program language)Computer programming
Read next: its neighbours on the mosaic
The C puzzle bookAlan R. Feuer · 1982 · recommended by 10 people · 3 people recommended both
The Standard C LibraryP. J. Plauger · 1991 · recommended by 17 people · 3 people recommended both
Expert C programming!Peter Van der Linden · 1994 · recommended by 88 people · 4 people recommended both
C interfaces and implementationsDavid R. Hanson · 1996 · recommended by 46 people · 5 people recommended both
C, a reference manualSamuel P. Harbison · 1984 · recommended by 30 people · 4 people recommended both
The UNIX programming environmentBrian W. Kernighan · 1984 · recommended by 86 people · 5 people recommended both
Advanced programming in the Unix environmentW. Richard Stevens · 1992 · recommended by 100 people · 5 people recommended both
Unix Network ProgrammingW. Richard Stevens · 1990 · recommended by 54 people · 5 people recommended both
Writing efficient programsJon Louis Bentley · 1982 · recommended by 9 people · 3 people recommended both
Programming PearlsJon Bentley · 1999 · recommended by 158 people · 3 people recommended both
Accelerated C++Andrew Koenig · 2000 · recommended by 47 people · 2 people recommended both
The C Programming LanguageBrian W. Kernighan · 1978 · recommended by 246 people · 4 people recommended both
The elements of programming styleBrian W. Kernighan · 1974 · recommended by 30 people · 2 people recommended both
More programming pearlsJon Louis Bentley · 1988 · recommended by 12 people · 2 people recommended both
Design concepts in programming languagesFranklyn A. Turbak · 2008 · recommended by 7 people · 2 people recommended both
Obfuscated C and other mysteriesDon Libes · 1993 · recommended by 4 people · similar by subject and what people say about it
Understanding and Using C PointersRichard M Reese · 2013 · recommended by 12 people · similar by subject and what people say about it
Pointers on CKenneth A. Reek · 1998 · recommended by 8 people · similar by subject and what people say about it
Java puzzlersJoshua Bloch · 2005 · recommended by 12 people · similar by subject and what people say about it
Code CompleteSteve McConnell · 1993 · recommended by 393 people · 4 people recommended both
C++ PrimerStanley B. Lippman · 1989 · recommended by 53 people · 2 people recommended both
Algorithms in C++Robert Sedgewick · 1990 · recommended by 27 people · 2 people recommended both
Essentials of programming languagesDaniel P. Friedman · 1992 · recommended by 43 people · 2 people recommended both
Effective C++Scott Meyers · 1991 · recommended by 112 people · 2 people recommended both