This chapter covers
- Insight into the origin of C++ programming mistakes
- Four analytical categories of proper code
- An approach to detecting and resolving programming mistakes
- Encouragement to take on the daunting task of correcting mistakes
As a C++ programmer, you have a daunting task: writing and supporting thousands—or millions—of lines of code. Fortunately, daunting is not the same as impossible! Learning from your mistakes and, more importantly, from the mistakes of C++ developers who have gone before you will prepare you to handle almost any situation you’re likely to encounter. Supporting C++ is a long-haul process, and you won’t master the language or the code base in just a few months. Dealing with frustration is a constant problem for developers in any language, often because of past decisions that have proven to be questionable or poor. Look for the good, the smart, and the elegant choices in others’ code, and you will soon be making the same choices in yours.
This book analyses 100 mistakes you’ll likely see (or make yourself) in modern and legacy C++ code. We aim to turn these mistakes into valuable insight you can use to create and maintain a cleaner, more efficient code base. Understanding the approach and fixes for each mistake should prepare you to find and resolve them—or avoid making them in the first place. Let’s get started!