When I joined Murach Books, my first assignment was to edit the second edition of C++ Programming. And my first thought upon getting my first assignment was, “Who the heck is still using C++ in 2022?” As it turns out, lots of people, which the book helpfully explains in the very first chapter. And you know what? It’s pretty dang convincing.
First, some background. C++ was the first programming language I learned, not counting some very basic Basic in DOS that my mother helped me set up to make some question trees. (Ah, GOTO statements are so nostalgic now…) C++ (specifically, C++98) was the language of choice for our high school’s AP Computer Programming class, so that’s what I used. Some of it was easy as long as you understood simple logic. If statements? For loops? Child’s play. But some of it sent my mind into a spiraling tailspin. What’s the difference between a pointer and a dereference again and why do I need to use either instead of proper variables? Garbage collection, meanwhile, might as well have been in one ear and out the other.
Then it was off to college where Java was preferred for anything object oriented or involving drawing graphics to the screen. C++ faded to the recesses of my brain, only trotted out occasionally if I happened to see the IT department working on something and had an unsolicited opinion. (IT for some reason did not appreciate this.) Eventually, when I decided to start programming again as a hobby, I picked up C# on a friend’s recommendation and fell in love with Microsoft’s documentation (I know, I was as surprised as anyone). Plus, it was now easy to draw things to the screen and import pngs. As far as I was concerned, C++ was truly done.
So, back to the present. My boss hands me the text for an updated tome on C++ and I am skeptical, but hey, a paycheck is a paycheck. The very first figure in the very first chapter, however, knows what I’m thinking because it lays out exactly why you want to learn C++ in 2022. “Speed. Portability. Scale. Job Security.” If you need your code to run as efficiently as possible without resorting to a lower-level language, C++ is the choice for you. And if you want job security, there’s a heck of a lot of legacy code out there that businesses are desperate to find someone to maintain as their original programmers retire. Not a bad deal.
So there I am, editing this book and dredging up memories two decades old as I follow along with the examples, making sure each line of code works as advertised and that I understand every explanation. And you know what? I did. Well, almost every explanation – I admit there were a couple that I still got stuck on - but I was in the very fortunate position of being able to talk directly to the writer, make suggestions, and be 100% certain the text is as clear and easy to understand as possible for readers regardless of skill level or half-forgotten memories.
The result is the book I wish I’d had back in high school, except in high school the section on pointers wouldn’t have been in the legacy section and modules were a pipe dream rather than the most convenient feature introduced in years. It’s the book I’m going to gift my brother, who’s just starting his career and could really use a reference to sound authoritative if anyone asks if he can take a look at some old code. It’s a book that says “C++ isn’t hard, you just need to understand some basic structures and apply them logically, and here are a bunch of examples holding your hand through exactly that.”
So, thanks boss! What language are we working on next?