Skip to Content
100 C++ Mistakes and How to Avoid Them
book

100 C++ Mistakes and How to Avoid Them

by Rich Yonts
January 2025
Intermediate to advanced
360 pages
10h 19m
English
Manning Publications

Overview

Learn how to handle errors, inefficiencies, and outdated paradigms by exploring the most common mistakes you’ll find in production C++ code.

100 C++ Mistakes and How To Avoid Them reveals the problems you’ll inevitably encounter as you write new C++ code and diagnose legacy applications, along with practical techniques you need to resolve them.

Inside 100 C++ Mistakes and How To Avoid Them you’ll learn how to:

  • Design solid classes
  • Minimize resource allocation/deallocation issues
  • Use new C++ features
  • Identify the differences between compile and runtime issues
  • Recognize C-style idioms that miss C++ functionality
  • Use exceptions well
100 C++ Mistakes and How To Avoid Them gives you practical insights and techniques to improve your C++ coding kung fu. Author Rich Yonts has been using C++ since its invention in the 1980s. This book distills that experience into practical, reusable advice on how C++ programmers at any skill level can improve their code. Unlike many C++ books that concentrate on language theory and toy exercises, this book is loaded with real examples from production codebases.

About the Technology
Over ten billion lines of C++ code are running in production applications, and 98-developers find and fix mistakes in them every day. Even mission-critical applications have bugs, performance inefficiencies, and readability problems. This book will help you identify them in the code you’re maintaining and avoid them in the code you’re writing.

About the Book
100 C++ Mistakes and How To Avoid Them presents practical techniques to improve C++ code, from legacy applications to modern codebases that use C++ 11 and beyond. Author Rich Yonts provides a concrete example to illustrate each issue, along with a step-by-step walkthrough for improving readability, effectiveness, and performance. Along the way, you’ll even learn how and where to replace outdated patterns and idioms with modern C++.

What's Inside
  • Design solid classes
  • Resource allocation/deallocation issues
  • Compile and runtime problems
  • Replace C-style idioms with proper C++


About the Reader
Covers C++ 98 through 23, with an emphasis on diagnosing and improving legacy code.

About the Author
Rich Yonts is a Senior Software Engineer at Teradata and a long-time software engineer using C++, Java, and Python. He has held a number of technical and leadership roles during his many years at IBM and Sony.

Quotes
A comprehensive collection of common pitfalls providing clear examples and practical advice on how to avoid them. An invaluable resource!
- Yacob Cohen-Arazi, NVIDIA

Examples were excellent, explained with in-depth detail that you can apply to your C++ projects!
- Stanley Anozie, Santander Consumer Bank AG

Methodical and practical! Addresses challenges faced by developers working with legacy codebases with clear, actionable solutions that bridge the gap between classical and modern C++.
- Matt Godbolt, Aquatic Capital Management

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Complete Modern C++ (C++11/14/17)

Complete Modern C++ (C++11/14/17)

Umar Lone
Introducing C++

Introducing C++

Frances Buontempo

Publisher Resources

ISBN: 9781633436893Publisher SupportPublisher Website