Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Debunking C++ Myths

You're reading from   Debunking C++ Myths Embark on an insightful journey to uncover the truths behind popular C++ myths and misconceptions

Arrow left icon
Product type Paperback
Published in Dec 2024
Publisher Packt
ISBN-13 9781835884782
Length 226 pages
Edition 1st Edition
Arrow right icon
Authors (2):
Arrow left icon
Ferenc Deak Ferenc Deak
Author Profile Icon Ferenc Deak
Ferenc Deak
Alexandru Bolboaca Alexandru Bolboaca
Author Profile Icon Alexandru Bolboaca
Alexandru Bolboaca
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Chapter 1: C++ Is Very Difficult to Learn 2. Chapter 2: Every C++ Program Is Standard-Compliant FREE CHAPTER 3. Chapter 3: There’s a Single C++, and It Is Object-Oriented 4. Chapter 4: The Main() Function is the Entry Point to Your Application 5. Chapter 5: In a C++ Class, Order Must There Be 6. Chapter 6: C++ Is Not Memory-Safe 7. Chapter 7: There’s No Simple Way to Do Parallelism and Concurrency in C++ 8. Chapter 8: The Fastest C++ Code is Inline Assembly 9. Chapter 9: C++ Is Beautiful 10. Chapter 10: There Are No Libraries For Modern Programming in C++ 11. Chapter 11: C++ Is Backward Compatible ...Even with C 12. Chapter 12: Rust Will Replace C++ 13. Index 14. Other Books You May Enjoy

What this book covers

Chapter 1, C++ Is Very Difficult to Learn, looks at why this is the case: is it the language or is it the teaching method? Should we start with low-level features such as pointers and memory management first, or would it perhaps be better to start with working examples or with the OOP features? Also, does every C++ programmer need to know the same C++? The chapter discusses different approaches to learning a language, with a focus on C++, and decides whether C++ is still difficult to learn today ... with the right method. [Alex]

Chapter 2, Every C++ Program Is Standard-Compliant, covers the question that the title suggests. In an ideal world, maybe they would be! In reality, every C++ program should be compliant. However, as we discover in this chapter, when they stray a little to the left or right, using an obscure compiler extension, dabbling in undefined behavior, or relying on a particular platform’s quirks, you instantly might find yourself in a tangle of errors only decipherable by ancient mystics. So, sure, every C++ program is “compliant” ... until it’s not! [Ferenc]

Chapter 3, There’s a Single C++, and It Is Object-Oriented, examines different paradigms of organizing code, including functional programming, meta programming, and the lesser-known extreme polymorphism. [Alex]

Chapter 4, The Main() Function is the Entry Point to Your Application, covers the topic mentioned in the title. In practice, as we will present in the chapter, the main() function is like the front door of your application: it’s where everything begins, but if you peek behind it, you’ll often find an intricate web of dependencies, libraries, and OS-dependent system calls that make reaching it feel more like navigating a maze than walking a straightforward path. [Ferenc]

Chapter 5, In a C++ Class, Order Must There Be, explores the fact that, sure enough, there must be order in a C++ class, since problems arise without it! Methods, data members, constructors, a place each must find! Yes, flexibility is, but ignored structure cannot be. Respect not the ordered members’ order request and crumble the class will! Freedom too much, and behavior, undefined, comes, errors, bugs, crashes! Disorder, C++ does not tolerate. With sequence respect, harmony reigns! The most important rules, this chapter presents, where the specified order of C++ concepts matters. Or it might not be specified at all, but still matters. [Ferenc]

Chapter 6, C++ Is Not Memory-Safe, explores the challenges of memory management in C++, the promise of modern language constructs, and their failures, in the context of increased awareness of the general public on software reliability. [Alex]

Chapter 7, There’s No Simple Way to Do Parallelism and Concurrency in C++, looks at the need for parallelism and concurrency, how modern C++ proposes to deal with them, and how the actor model can help design parallelism in your products. [Alex]

Chapter 8, The Fastest C++ Code Is Inline Assembly, covers a fact we were taught three decades ago. While assembly does indeed offer low-level control, modern compilers are highly optimized and often generate more efficient code than hand-written assembly, as we will demonstrate in the chapter. Indeed, inline assembly can improve performance in some cases, but it sacrifices readability and portability, so use it sparingly and only when absolutely necessary. [Ferenc]

Chapter 9, C++ Is Beautiful, asserts that C++ is indeed beautiful because where else can you find a language so gracefully tangled in angle brackets, semicolons, curly braces, and periods? It’s a poetic dance of keywords, templates, ancient macros, and overloaded operators, all elegantly arranged to make even the most seasoned programmers question their life choices. Truly, as the chapter will showcase, C++ syntax is the epitome of beauty, if beauty means a riddle wrapped in an enigma, with just a hint of confusion after preprocessing again the unpreprocessable. [Ferenc]

Chapter 10, There Are No Libraries For Modern Programming in C++, evaluates the need and availability of libraries for C++, the challenges of package management, the difficulties in finding libraries for your target version and architecture, and the increasing problem of supply chain attacks. [Alex]

Chapter 11, C++ Is Backward Compatible ... Even With C, explores backward compatibility because, as we will present in the chapter, C++ inherits the family heirloom: a messy pile of global variables, pointy pointers, and undefined behavior. C++ dutifully keeps these relics alive, allowing the two languages to coexist in an awkward, yet somehow functional, embrace. Compatibility, indeed, because who doesn’t want the thrill of mixing decades-old C code with modern C++? Or with not-so-modern C++? We mean, hey, tradition is important, and we must clamber for a living! [Ferenc]

Chapter 12, Rust Will Replace C++, looks at why we have so many programming languages, how Rust fits into the ecosystem and what it does well, C++’s answer, and the conditions under which Rust might replace C++. [Alex]

lock icon The rest of the chapter is locked
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.
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 $19.99/month. Cancel anytime
Banner background image