Accelerated C++ Crash Course
Accelerated C++ Crash Course
Summary:
Introduction
The book «Accelerated C++: Practical Programming by Example» by Andrew Koenig and Barbara Moo is not just another programming language textbook. It is a manifesto of a new approach to learning C++, which fundamentally differs from classic tomes like Bjarne Stroustrup's «The C++ Programming Language». Published in 2000, this book still remains one of the most effective introductions to C++ for those who already know how to program in other languages (Java, Python, C#).
The authors are recognized experts in the world of C++: Andrew Koenig was one of the first members of the C++ standardization committee, and Barbara Moo is a co-author of several books and a long-time editor. Their goal was ambitious: to teach writing real, modern C++ from day one, bypassing outdated practices and bare C-like code.
What is this book about?
Unlike traditional textbooks that start with data types, loops, and functions, «Accelerated C++» immediately immerses the reader in working with the standard library (STL). The very first program uses vector, string, and iostream. The authors assume that the reader is already familiar with basic programming concepts (variables, conditions, loops), so they do not waste time explaining these fundamentals.
The book is built on examples. Each chapter is a complete program that solves a specific problem: from word counting to working with images. Gradually, from chapter to chapter, new concepts are introduced: iterators, algorithms, containers, classes, templates, memory management. By the end of the book, the reader will not only master the syntax but also understand the philosophy of C++: RAII, exceptions, copy-and-swap idioms.
Who is this book for?
The book is intended for experienced programmers who want to learn C++ quickly and effectively. If you have worked with Java, Python, or C# and want to switch to C++ for system programming, games, or high-load applications — this is your choice. Beginners who are just starting their journey in programming will find the book too difficult and fast-paced.
What will the reader learn?
- Standard Library (STL): containers (
vector,list,map), iterators, algorithms (sort,find,copy). - Working with strings and input/output:
string,iostream, file streams. - Object-Oriented Programming in C++: classes, encapsulation, inheritance, polymorphism.
- Templates: writing generic code, template functions and classes.
- Memory Management: smart pointers (
shared_ptr— the book usesauto_ptr, which is outdated, but the concept is correct), RAII, preventing leaks. - Exception Handling: safe code, exception guarantees.
- C++ Idioms: copy-and-swap, pimpl, RAII idiom.
- Program Design: modularization, header files, namespaces.
Strengths of the book
1. Practical focus. Each chapter contains a complete example that can be immediately run and modified. Theory is provided exactly in the amount necessary to understand the example.
2. Modern C++ (for its time). The book teaches using the STL rather than reinventing the wheel. The authors consistently avoid outdated constructs (e.g., C-style arrays, raw pointers for memory ownership).
3. Logical structure. The material is presented in a spiral: first simple examples, then they become more complex, adding new details. This allows gradually increasing complexity without overload.
4. Emphasis on idioms. The book explains not just