Writing Bug-Free C Code
A Programming Style That Automatically Detects Bugs in C Code
by Jerry Jongerius / January 1995
<< Previous Index Next >>

Note to this online book: On April 29, 2002, I reacquired the publishing rights to my book (from Prentice Hall, published Feb 1995), and have decided to publish it online, where it is now freely available for anyone to read (and print - provided that the printed copy is only for your personal use). I have personally moved on to the Java programming language, JavaScript, HTML5, etc. This book is showing its age, but for anyone who still programs in C, the techniques described in this book -- especially the class methodology in Chapter 4, with runtime type checking and fault tolerant functions -- are still an incredible 'little gem' worth knowing about. Enjoy!

0. Preface
1. Understand Why Bugs Exist
2. Know Your Environment
3. Rock-Solid Base
4. The Class Methodology
5. A New Heap Manager
6. Designing Modules
7. General Tips
8. Style Guide
9. Conclusion
A. Appendix: Code Listings
References
  C Programming with:
  • Class Methodology §4
  • Complete data hiding §4.2
  • Runtime type checking §4.4
  • Compile time type checking §4.3
  • Fault tolerant asserts §3.3
  • Fault tolerant functions §4.6
  • Compile-time asserts §2.1.4
  • Symbolic heap walking §5.2.9
  • Heap leak detection §5.5

Book C Source Code (9k): source.zip (for DOS, Windows, UNIX, etc)

  Sections of this book that talk about Microsoft or Windows are generally marked with the 'Windows' graphic. You can safely skip those sections of this book if you want to.

Copyright © 1993-1995, 2002-2024 Jerry Jongerius, jerryj@duckware.com
This book was previously published by Pearson Education, Inc.,
formerly known as Prentice Hall. ISBN: 0-13-183898-9
Check Amazon for used paperback availability