100 C++ Mistakes and How to Avoid Them (Final Release)КНИГИ » ПРОГРАММИНГ
Название: 100 C++ Mistakes and How to Avoid Them (Final Release) Автор: Rich Yonts Издательство: Manning Publications Год: 2025 Страниц: 532 Язык: английский Формат: pdf, epub (true), mobi Размер: 10.1 MB
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.
Learning C++ is mainly about applying its language features in an environment to solve specific problems. Teaching C++ in a college environment differs from mentoring a junior developer in a work environment, yet the language is the same. Think of C++ as the common language (pun intended) that developers speak at the lowest level. Design patterns, conventional use, problem domain specifics, and company processes are higher levels of communication. These higher levels are the most critical; Alan Turing demonstrated that any single computer can compute a solvable problem that any other computer can, differing only in approach and time. Likewise, any language can solve a computational problem that C++ can solve.
This thought is not meant to criticize C++ (or any other language) in any way, only to establish that, in a business that uses C++, that fact is of almost no consequence to the overall direction of the company and the problems it solves. Your skill at becoming a seasoned developer is of much greater importance than your (simple?) knowledge of a specific programming language.
With all that said, why this book about C++? Earlier, we established that you will be introduced to an environment that uses C++. Given your interest and skills in the language, you will have the opportunity to apply your knowledge and skills in solving problems that the company cares about. You will be using C++ to do that work. Therefore, knowing how to identify some of the mistakes that are common in C++ gives you the ability to mitigate them and, more importantly, not repeat them. Having to work in a code base that uses specific approaches narrows your opportunity to use C++ in its most expressive and proper way. For example, many string-handling solutions use C idioms, such as strcat, strstr, and strcpy. If this is common practice, you may feel inclined, even pressured, to use the same, although these functions should be avoided in preference to C++ approaches.
C++ is a very flexible language, allowing a programmer to do anything made possible by their machine. Many more modern languages abstract away much of the details and complexity of the machine. Notable exceptions are Go and Rust. C++ unapologetically provides the lowest level of detail for manipulating machine characteristics. This approach makes it a compelling language for working with low-level details.
However, this flexibility and granularity come at a cost. One cannot program C++ with the “looseness” of Python or Java. For example, C++ provides no default garbage collector to manage memory and resources. The developer must handle these details themselves. Numerous mistakes are made around resource management, which can significantly impact program performance and correctness.
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.
Скачать 100 C++ Mistakes and How to Avoid Them (Final Release)