Safe C++ How to avoid common mistakes 1st Edition by Vladimir Kushnir – Ebook PDF Instant Download/Delivery:1449321372, 9781449321376
Full download Safe C++ How to avoid common mistakes 1st Edition after payment
Product details:
ISBN 10: 1449321372
ISBN 13: 9781449321376
Author: Vladimir Kushnir
It’s easy to make lots of programming mistakes in C++—in fact, any program over a few hundred lines is likely to contain bugs. With this book, you’ll learn about many common coding errors that C++ programmers produce, along with rules and strategies you can use to avoid them. Author Vladimir Kushnir shows you how to use his Safe C++ library, based in part on programming practices developed by the C++ community. You’ll not only find recipes for identifying errors during your program’s compilation, runtime, and testing phases, you’ll learn a comprehensive approach for making your C++ code safe and bug-free. Get recipes for handling ten different error types, including memory leaks and uninitialized variables Discover problems C++ inherited from C, like pointer arithmetic Insert temporary and permanent sanity checks to catch errors at runtime Apply bug prevention techniques, such as using separate classes for each data type Pursue a testing strategy to hunt and fix one bug at a time—before your code goes into production
Table of contents:
How This Book Is Organized
Conventions Used in This Book
Naming Conventions
Using Code Examples
Safari® Books Online
How to Contact Us
Acknowledgments
I. A Bug-Hunting Strategy for C++
1. Where Do C++ Bugs Come From?
2. When to Catch a Bug
Why the Compiler Is Your Best Place to Catch Bugs
How to Catch Bugs in the Compiler
The Proper Way to Handle Types
3. What to Do When We Encounter an Error at Runtime
II. Bug Hunting: One Bug at a Time
4. Index Out of Bounds
Dynamic Arrays
Static Arrays
Multidimensional Arrays
5. Pointer Arithmetic
6. Invalid Pointers, References, and Iterators
7. Uninitialized Variables
Initialized Numbers (int, double, etc.)
Uninitialized Boolean
8. Memory Leaks
Reference Counting Pointers
Scoped Pointers
Enforcing Ownership with Smart Pointers
9. Dereferencing NULL Pointers
10. Copy Constructors and Assignment Operators
11. Avoid Writing Code in Destructors
12. How to Write Consistent Comparison Operators
13. Errors When Using Standard C Libraries
III. The Joy of Bug Hunting: From Testing to Debugging to Production
14. General Testing Principles
15. Debug-On-Error Strategy
16. Making Your Code Debugger-Friendly
17. Conclusion
People also search for:
c++ mistakes to avoid
common c++ errors
mistakes c++
common c++ mistakes
safe c++
Tags:
Vladimir Kushnir,common,mistakes