Book Image

Expert C++

By : Vardan Grigoryan, Shunguang Wu
5 (1)
Book Image

Expert C++

5 (1)
By: Vardan Grigoryan, Shunguang Wu

Overview of this book

C++ has evolved over the years and the latest release – C++20 – is now available. Since C++11, C++ has been constantly enhancing the language feature set. With the new version, you’ll explore an array of features such as concepts, modules, ranges, and coroutines. This book will be your guide to learning the intricacies of the language, techniques, C++ tools, and the new features introduced in C++20, while also helping you apply these when building modern and resilient software. You’ll start by exploring the latest features of C++, and then move on to advanced techniques such as multithreading, concurrency, debugging, monitoring, and high-performance programming. The book will delve into object-oriented programming principles and the C++ Standard Template Library, and even show you how to create custom templates. After this, you’ll learn about different approaches such as test-driven development (TDD), behavior-driven development (BDD), and domain-driven design (DDD), before taking a look at the coding best practices and design patterns essential for building professional-grade applications. Toward the end of the book, you will gain useful insights into the recent C++ advancements in AI and machine learning. By the end of this C++ programming book, you’ll have gained expertise in real-world application development, including the process of designing complex software.
Table of Contents (22 chapters)
1
Section 1: Under the Hood of C++ Programming
7
Section 2: Designing Robust and Efficient Applications
17
Section 3: C++ in the AI World

What this book covers

Chapter 1, Introduction to Building C++ Applications, contains an introduction to the C++ world, its applications, and recent updates to the language standard. This chapter also includes a good overview of the topics covered by C++ and an introduction to the code compilation, linking, and execution phases.

Chapter 2, Low-Level Programming with C++, focuses on a discussion of C++ data types, arrays, pointers, and addressing and manipulation with pointers, along with low-level details of conditionals, loops, functions, function pointers, and structs. This chapter also includes an introduction to structures (structs).

Chapter 3, Details of Object-Oriented Programming, dives into the structure of classes and objects, and how a compiler implements object lifetimes. By the end of this chapter, the reader will understand the implementation details of inheritance and virtual functions, as well as the essential inner details of OOP in C++.

Chapter 4, Understanding and Designing Templates, introduces C++ templates, examples of template functions, template classes, template specialization, and template meta-programming in general. Traits and meta-programming will incorporate the magic in C++ applications.

Chapter 5, Memory Management and Smart Pointers, dives into the details of memory sections, allocation, and management in general, including the use of smart pointers to avoid potential memory leaks.

Chapter 6, Digging into Data Structures and Algorithms in STL, introduces data structures and their STL implementation. This chapter also includes a comparison of data structures and a discussion of proper applications with real-world examples.

Chapter 7, Functional Programming, focuses on functional programming, which is a different programming paradigm, allowing readers to concentrate on the "functional" rather than the "physical" structure of the code. Mastering functional programming provides developers with a new skill that helps to offer even better solutions to problems.

Chapter 8, Concurrency and Multithreading, focuses on how to make your programs run faster by leveraging concurrency. When an efficient data structure with efficient algorithms hits the limits of program performance, concurrency comes to the rescue.

Chapter 9, Designing Concurrent Data Structures, focuses on leveraging data structures and concurrency to design lock-based and lock-free concurrent data structures.

Chapter 10, Designing World-Ready Applications, focuses on incorporating the knowledge acquired from previous chapters into designing robust real-world applications by using design patterns. This chapter also includes understanding and applying domain-driven design by designing an Amazon clone.

Chapter 11, Designing a Strategy Game Using Design Patterns, deals with incorporating the knowledge acquired from previous chapters into designing a strategy game by using design patterns and best practices.

Chapter 12, Networking and Security, introduces network programming in C++ and how to build a dropbox backend clone by leveraging network programming skills. This chapters also includes a discussion of how to ensure coding best practices.

Chapter 13, Debugging and Testing, focuses on debugging C++ applications and best practices to avoid bugs in code, applying static code analysis in order to reduce issues in the program, introduction, and application of test-driven development and behavior-driven development. This chapter also includes a discussion of the difference between behavior-driven development and TDD as well as use cases.

Chapter 14, Graphical User Interface with Qt, introduces the Qt library and its main components. This chapter also includes an understanding of the cross-platform nature of the Qt, continuing the dropbox example by building a simple desktop client.

Chapter 15, Using C++ in Machine Learning Tasks, deals with a brief introduction to the AI concepts and recent developments in the field. This chapter also includes an introduction to machine learning and tasks such as regression analysis and clustering, as well as how to build a simple neural network.

Chapter 16, Implementing a Dialog-Based Search Engine, deals with applying the knowledge of all previous chapters to design an efficient search engine described as dialog-based because it finds the right document by asking (and learning) the corresponding questions of the user.