Reader small image

You're reading from  Expert C++ - Second Edition

Product typeBook
Published inAug 2023
PublisherPackt
ISBN-139781804617830
Edition2nd Edition
Right arrow
Authors (5):
Marcelo Guerra Hahn
Marcelo Guerra Hahn
author image
Marcelo Guerra Hahn

Marcelo Guerra Hahn, With over 18 years of experience in software development and data analysis, Marcelo Guerra Hahn is a seasoned expert in C++, C#, and Azure. As an Engineering Manager at Microsoft C++ Team and former leader of SoundCommerce's engineering team, Marcelo's passion for data and informed decision-making shines through. He shares his knowledge as a lecturer at esteemed institutions like Lake Washington Institute of Technology and University of Washington. Through this book, Marcelo aims to empower readers with advanced C++ techniques, honed by real-world experience, to become proficient programmers and skilled data analysts.
Read more about Marcelo Guerra Hahn

Araks Tigranyan
Araks Tigranyan
author image
Araks Tigranyan

Araks Tigranyan is a passionate software engineer at Critical Techworks, with an unwavering love for the world of programming, particularly in C++. Her dedication to crafting efficient and innovative solutions reflects her genuine passion for coding. Committed to excellence and driven by curiosity, Araks continuously explores new technologies, going above and beyond to deliver exceptional work. Beyond programming, Araks finds solace in sports, with football holding a special place in her heart. As an author, Araks aspires to share her profound expertise in C++ and inspire readers to embark on their programming journeys.
Read more about Araks Tigranyan

John Asatryan
John Asatryan
author image
John Asatryan

John Asatryan, the Head of Code Republic Lab at Picsart Academy, seamlessly blends his academic background in International Economic Relations from the Armenian State University of Economics with his ventures in technology and education. Driven by a genuine passion for coding, John's commitment to empowering aspiring developers is evident in his expertise in the field. His unwavering dedication to bridging the gap between education and technology inspires others to pursue their coding dreams.
Read more about John Asatryan

Vardan Grigoryan
Vardan Grigoryan
author image
Vardan Grigoryan

Vardan Grigoryan is a senior backend engineer and C++ developer with more than 9 years of experience. Vardan started his career as a C++ developer and then moved to the world of server-side backend development. While being involved in designing scalable backend architectures, he always tries to incorporate the use of C++ in critical sections that require the fastest execution time. Vardan loves tackling computer systems and program structures on a deeper level. He believes that true excellence in programming can be achieved by means of a detailed analysis of existing solutions and by designing complex systems.
Read more about Vardan Grigoryan

Shunguang Wu
Shunguang Wu
author image
Shunguang Wu

Shunguang Wu is a senior professional staff at Johns Hopkins University Applied Physics Laboratory, and received his PhDs in theoretical physics and electrical engineering from Northwestern University (China) and Wright State University (USA), respectively. He published about 50 reviewed journal papers in the area of nonlinear dynamics, statistical signal processing and computer vision in his early career. His professional C++ experience started with teaching undergraduate courses in the late 1990s. Since then he has been designing and developing lots of R&D and end-user application software using C++ in world-class academic and industrial laboratories. These projects span both the Windows and Linux platforms.
Read more about Shunguang Wu

View More author details
Right arrow

Preface

Welcome to Expert C++! If you are an experienced C++ developer eager to elevate your skills and explore the full potential of C++20, you’ve come to the right place.

In this expert guide, we have meticulously crafted a learning journey to empower you with advanced programming techniques and practical knowledge that goes beyond traditional object-oriented programming. Whether you aspire to design high-performance applications, work with cutting-edge data structures, or master multithreading and concurrency, this book is your ultimate companion.

We will take you through the intricacies of designing templates, including the powerful realm of template metaprogramming. Memory management and smart pointers will become your allies as you tackle complex projects with confidence. Delve into the realm of data structures using the Standard Template Library (STL) containers, and then push the boundaries further with advanced data structures in C++. Discover the elegance of functional programming and the intricacies of concurrency and multithreading, all while learning to design concurrent data structures.

As you progress, we will guide you through the process of creating world-ready applications, incorporating essential design patterns, and understanding networking and security principles. The book’s culmination will be your enlightenment on debugging and testing, followed by a profound exploration of large-scale application design.

Whether you aspire to develop enterprise-level software or cutting-edge projects, this book is designed to empower you to become a proficient C++ programmer. So, waste no time and embark on this transformative journey.

Happy coding!

Who this book is for

The primary target audience consists of experienced C++ developers who are eager to elevate their skills and create professional-grade applications. Whether you wish to master complex programming concepts, improve application performance, or explore advanced techniques, this book will serve as a valuable resource in your journey.

The secondary target audience encompasses software engineers and computer science students with an interest in learning advanced C++ programming techniques and discovering real-world applications of the language. By delving into the content of this book, you can expand your knowledge and develop practical expertise in utilizing C++ for various projects and challenges.

Regardless of your background or experience level, “Expert C++” aims to empower you with valuable insights and practical knowledge, guiding you towards becoming a proficient and capable C++ programmer.

What this book covers

Chapter 1, Building C++ Applications, will touch upon topics such as the application-building process in C++ and the low-level details of C++ applications

Chapter 2, Beyond Object-Oriented Programming, dives deeply into the design of OOP

Chapter 3, Understanding and Designing Templates, talks about the syntax of function and class templates, their instantiations, and their specializations.

Chapter 4, Template Meta Programming, provides you with the knowledge and skills you need to master template metaprogramming.

Chapter 5, Memory Management and Smart Pointers, illuminates the mystery behind memory and proper memory management techniques.

Chapter 6, Digging into Data Structures and Algorithms in STL, covers a wide range of data structures and algorithms.

Chapter 7, Advanced Data Structures, dives even deeper into what data structures there are, some of which you may have never heard about before.

Chapter 8, Functional Programming, talks about the fundamental blocks of functional programming, as well as ranges.

Chapter 9, Concurrency and Multithreading, introduces you to concurrency and multithreading fundamentals in C++ and the best practices for concurrent code design.

Chapter 10, Designing Concurrent Data, will help you picture problems with data races and acquire the basic knowledge needed to design concurrent algorithms and data structures.

Chapter 11, Designing World-Ready Applications, addresses common design ideas that will help prevent errors and write world-ready applications.

Chapter 12, Incorporating Design Patterns in C++ Applications, we will analyze examples of using design patterns in C++ applications in various different areas.

Chapter 13, Networking and Security, discuss the standard networking extension and see what is needed to implement networking-supported programs.

Chapter 14, Debugging and Testing, describes the analysis of a software defect, the use of the GNU Debugger (GDB) tool to debug a program, and the use of tools to automatically analyze software.

Chapter 15, Large-Scale Application Design, discusses the practices behind building data-intensive applications and explores data partitioning, replication, caching, and data flow optimization.

Chapter 16, Understanding and Using C++ in Machine Learning Tasks, introduce the concepts of AI and ML and also provides examples of tasks in ML. We are going to implement them and give you a basic idea of how you should research and move forward with solving more complex tasks.

Chapter 17, Using C++ in Data Science, explains why C++ can be used in the data science industry and how it makes it possible.

Chapter 18, Designing and Implementing a Data Analysis Framework, explores the basic steps of building a complex data analysis program using C++.

To get the most out of this book

The g++ compiler with the option -std=c++2a is used to compile the examples throughout the book.

Software/hardware covered in the book

Operating system requirements

g++ compiler

Ubuntu Linux is a plus, but not a requirement

Basic C++ experience, including a familiarity with memory management, object-oriented programming, and basic data structures and algorithms, will be a big plus.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Expert-C-2nd-edition. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “We sort the numericalData vector and calculate the median based on size and values”

A block of code is set as follows:

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>

Any command-line input or output is written as follows:

std::unique_ptr<Base> ptr =     std::make_unique_default_init<Derived> ();
ptr->test();

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at customercare@packtpub.com and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you’ve read Expert C++, 2nd edition, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere? Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application. 

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

  1. Scan the QR code or visit the link below

https://packt.link/free-ebook/9781804617830

  1. Submit your proof of purchase
  2. That’s it! We’ll send your free PDF and other benefits to your email directly
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Expert C++ - Second Edition
Published in: Aug 2023Publisher: PacktISBN-13: 9781804617830
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (5)

author image
Marcelo Guerra Hahn

Marcelo Guerra Hahn, With over 18 years of experience in software development and data analysis, Marcelo Guerra Hahn is a seasoned expert in C++, C#, and Azure. As an Engineering Manager at Microsoft C++ Team and former leader of SoundCommerce's engineering team, Marcelo's passion for data and informed decision-making shines through. He shares his knowledge as a lecturer at esteemed institutions like Lake Washington Institute of Technology and University of Washington. Through this book, Marcelo aims to empower readers with advanced C++ techniques, honed by real-world experience, to become proficient programmers and skilled data analysts.
Read more about Marcelo Guerra Hahn

author image
Araks Tigranyan

Araks Tigranyan is a passionate software engineer at Critical Techworks, with an unwavering love for the world of programming, particularly in C++. Her dedication to crafting efficient and innovative solutions reflects her genuine passion for coding. Committed to excellence and driven by curiosity, Araks continuously explores new technologies, going above and beyond to deliver exceptional work. Beyond programming, Araks finds solace in sports, with football holding a special place in her heart. As an author, Araks aspires to share her profound expertise in C++ and inspire readers to embark on their programming journeys.
Read more about Araks Tigranyan

author image
John Asatryan

John Asatryan, the Head of Code Republic Lab at Picsart Academy, seamlessly blends his academic background in International Economic Relations from the Armenian State University of Economics with his ventures in technology and education. Driven by a genuine passion for coding, John's commitment to empowering aspiring developers is evident in his expertise in the field. His unwavering dedication to bridging the gap between education and technology inspires others to pursue their coding dreams.
Read more about John Asatryan

author image
Vardan Grigoryan

Vardan Grigoryan is a senior backend engineer and C++ developer with more than 9 years of experience. Vardan started his career as a C++ developer and then moved to the world of server-side backend development. While being involved in designing scalable backend architectures, he always tries to incorporate the use of C++ in critical sections that require the fastest execution time. Vardan loves tackling computer systems and program structures on a deeper level. He believes that true excellence in programming can be achieved by means of a detailed analysis of existing solutions and by designing complex systems.
Read more about Vardan Grigoryan

author image
Shunguang Wu

Shunguang Wu is a senior professional staff at Johns Hopkins University Applied Physics Laboratory, and received his PhDs in theoretical physics and electrical engineering from Northwestern University (China) and Wright State University (USA), respectively. He published about 50 reviewed journal papers in the area of nonlinear dynamics, statistical signal processing and computer vision in his early career. His professional C++ experience started with teaching undergraduate courses in the late 1990s. Since then he has been designing and developing lots of R&D and end-user application software using C++ in world-class academic and industrial laboratories. These projects span both the Windows and Linux platforms.
Read more about Shunguang Wu