1 C++: With Great Power Comes Great Responsibility

 

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

C++ is a multi-paradigm language that has existed for much of the computing era. It started as a better C, that is, C with classes, and has become an international standards-based language in active development. At the time of this writing, the C++20 standard was published, the C++23 standard was out for final, and the C++26 standard was being formed. C++ is used in projects ranging from very small to very large by inexperienced to highly experienced developers and applies to most areas of software development.

An estimated 10 billion lines of C++ code are currently running in production environments. Numerous teams and millions of developers from different backgrounds have written this code over a span of years. Each developer has a view of proper programming models, what good C++ code is, and which development methodologies should be used.

1.1 Technology Used

1.2 The Intended Reader

1.3 Why This Book?

1.3.1 Organization

1.3.2 Class Design

1.3.3 Program Implementation

1.3.4 Library Issues

1.3.5 Modern C++

1.4 Origins of a Mistake

1.4.1 Old Standards and Usage

1.4.2 Lost Expertise and Misguided Training

1.4.3 Limitations of this Book

1.5 Resolving Mistakes

1.5.1 If Only There Were Time…

1.5.2 A Quick Example

1.6 Anatomy of a Mistake

1.6.1 Correctness

1.6.2 Readability

1.6.3 Effectiveness

1.6.4 Performance

1.7 What to Expect from This Book

1.7.1 Noticing Mistakes

1.7.2 Understanding Mistake

1.7.3 Fixing Mistakes

1.7.4 Learning from Mistakes

1.8 Summary