In January, I was lucky to get a relatively new book on Modern C++! This time it’s not aimed at experts but rather at the beginner level. It’s called “Modern C++ for Absolute Beginners,” written by Slobodan Dmitrović. I think it might be a valuable resource for job interviews.

Let’s see what’s inside.

Disclaimer: I got a free copy from the author.

The book  

The book on Amazon:

Modern C++ for Absolute Beginners: A Friendly Introduction to C++ Programming Language and C++11 to C++20 Standards 1st ed. Edition @Amazon (released in July 2020).

The book page at APress:

Modern C++ for Absolute Beginners

Github repository with all samples:

Apress/modern-cpp-for-absolute-beginners @Github

The Author  

Slobodan Dmitrović

Slobodan is a software development consultant, C, and C++ trainer, and author of two programming books. He specializes in training, research and development, and consulting. Slobodan has been working as a professional software developer for more than twenty years. Since 2019 he has been dedicated to providing training and consulting services, speaking at conferences, and writing programming books. Slobodan provides C and C++ training services to corporate clients through his company: C++ and Friends.

You can also hear an episode of C++Cast with Slobodan where he talks about his other book for C: Jan 6, 2022 - Modern C for Absolute Beginners @C++Cast.

Let’s see what’s inside the book.

The Structure  

We have 40 small chapters in total:

  1. Introduction
  2. What is C++?
  3. C++ Compilers
  4. Our First Program
  5. Types
  6. Exercises
  7. Operators
  8. Standard Input
  9. Exercises
  10. Arrays
  11. Pointers
  12. References
  13. Introduction to Strings
  14. Automatic Type Deduction
  15. Exercises
  16. Statements
  17. Constants
  18. Exercises
  19. Functions
  20. Exercises
  21. Scope and Lifetime
  22. Exercises
  23. Classes - Introduction
  24. Exercises
  25. Classes – Inheritance and Polymorphism
  26. Exercises
  27. The static Specifier
  28. Templates
  29. Enumerations
  30. Exercises
  31. Organizing code
  32. Exercises
  33. Conversions
  34. Exceptions
  35. Smart Pointers
  36. Exercises
  37. Input/Output Streams
  38. C++ Standard Library and Friends
  39. Exercises
  40. C++ Standards

While the number of chapters is impressive, the whole book is only 300 pages in length, giving us only 7,5 pages per chapter. And some of them are only two or four pages.

Still, it’s essential to keep in mind that that was the whole point of the book, to keep it short and provide a valuable introduction to Modern C++.

As you can see from the list, we start from something straightforward - like creating a hello world example to more advanced topics. After a chapter or two, there’s an “exercise” section where you can see questions about the topics from the previous parts.

My View  

“Modern C++ …” is a relatively short book, however thanks to many valuable examples and a gradual increase in complexity, it delivers its goals.

When I got this book, I immediately thought it could be a valuable resource for job interviews. Rather than going through tons of pages from various books, you can just use this book and prepare for the core topics from C++. While it won’t give you enough material for a senior position in C++, it will prepare you for junior/mid jobs or in a situation where C++ is not the dominant language in that position.

During the reading, I sometimes noticed the lack of some important topics like the Rule of Zero, explicit constructors, or some more advanced examples of templates. Still, that’s an unfair view of someone who uses C++ a lot, and won’t be a problem for someone who just started with C++. Maybe it’s even better, as there’s smaller “information overload”.

I like that Slobodan selected a good range of topics to cover. As an example, let’s take the Smart Pointers chapter. To keep it short, he focused on unique_ptr and shared_ptr, but left weak_ptr. This is the right choice, as weak_ptr is probably not something you need to know when starting your C++ journey. Slobodan also points out why using raw pointers is not the best approach and alternatives Modern C++ offers.

In summary, I like the book, and I can recommend it to anyone looking for reliable and easy-to-read materials.

Summary  

Final mark: 4/5

Pros:

  • Concise - the book delivers its promises and goals
  • Lots of examples
  • Gradual increase of the complexity, so you go from simple topics to more advanced.
  • The last chapter is a cool overview of the latest C++ Standards
  • Well written and precise

Cons:

  • Some chapters are really short, like 2 pages only - some more description, more examples would be helpful there to “fill the gap”
  • Some topics were left out (like explicit ctors, rule of zero) - but maybe that’s not aimed at the beginner level, so that’s not a strong point.