Dare to begin with C++
Learning a new language is much more than just learning familiarising yourself with language syntax and features. To write safe and efficient production quality code you need to know which language capabilities to use and when. Especially with a language like C++ where there are a stunning number of ways to do the same thing. This is something we normally learn with real practice of using the technology.
This is a short note with a list of resources where you can enter the incredible world of C++.
📽 Videos#
This is a list of a few great videos and entire channels with lectures about C++, that I regularly watch myself and recommend to others.
Sole lectures#
- RAII is a powerful concept which is widely used in C++. For instance standard containers and smart pointers are based on it. 📼 RAII by Arthur O'Dwyer
- Move is one of the most powerful features of modern C++. If you are not familiar with it, please watch the video at least partially, it's tremendously useful for understanding modern code. 📼 Move Semantics by David Olsen
- There are at least 2 categories of values and references in C++, without understanding that some parts of the code just don't make any sense. This is an explanation of move semantics from a more theoretical point of view. 📼 Understanding Value Categories by Ben Saks
- Pointers and memory management set C++ aside from other modern languages, because of this it is important to understand some basics about it. 📼 Pointers and Memory by Ben Saks
- Smart pointersr are everywhere in modern C++, and sadly most of the time they are used wrong. Knowing at least the high level ideas of them would help you to avoid problems. 📼 Smart Pointers by Arthur O'Dwyer
- This is a high level overview on standard C++ library. It is quite entertaining, considering how dull the topic may seem. 📼 105 STL Algorithms in Less Than an Hour
- Lambdas are relatively a new thing for C++, but once added they greatly changed the landscape and now they are everywhere. But as with everything in C++ it is a powerful tool, but it can be traky and dangerous. 📼 Lambdas from Scratch by Arthur O'Dwyer
- Templates are a whole magic world in C++, which very few people understand completely. But if you are serious about learning C++, this is something you surely need to know. A great intro into the world of C++ templates in 2 parts: 📼 Template Metaprogramming: Type Traits (part 1 of 2) - Jody Hagins - CppCon 2020, 📼 Template Metaprogramming: Type Traits (part 2 of 2) - Jody Hagins - CppCon 2020.
- This is one of the greatest talks from a rock star of C++ Andrei Alexandrescu. If you want to learn something witty in C++, this guy’s talks is what you are looking for. 📼 CppCon 2015: Andrei Alexandrescu “std::allocator...”
Channels#
- Cᐩᐩ Weekly With Jason Turner. The channel with short videos about key features of the language, debug sessions and live coding. There is few examples:
- CppCon channel. The community of the language is huge, so there are multiple events that happen around the globe yearly. CppCon is probably the largest with lots of famous speakers and great learning materials. All lectures eventually are published on youtube, it’s not necessary to visit the event personally.
📚 Books#
The oldest and fundamental way to learn something is to read book. I don’t recommend reading thick folios like “Programming: Principles and Practice Using C++” by Bjarne Stroustrup (more than 1300 pages). This is a great book by all means, but for the beginning it could easily scare you away. There are some thinner and much more practical books that could save you many days of meditation with a debugger and tons of money.
- “A Tour of C++”, by Bjarne Stroustrup. A brief and clear intro to modern C++ from the author and father of the language. Great starting point for someone who is new to the language, but knows some other programming language.
- “Effective modern C++”, by Scott Meyers.. Scott Meyers was a software consultant in C++ world for many years since the beginning of the language's popularity. Over the years he mastered the skill to explain complex things in a way that is very easy to understand. He wrote a series of books “Effective C++” with very practical advice that saved a great deal of money for companies and eons of engineers time. I recommend the last book of the series only, because the early ones might seem a little outdated today. The language has evolved quite a lot since then.
- “C++ best practices”, by Jason Turner. This is another great example of a thin and very practical book about modern C++. It is designed in a way that is useful for both total beginners and experienced engineers who wish to fill the gaps in features of modern C++ standards. It’s very concise and crispy, more like a cookbook with the most essential recipes and no lyrical digressions.
- “The C Programming Language”, by Brian Kernighan and Dennis Ritchie. This book is so famous that it is sometimes termed just as “K&R” after its authors' initials. The modern C++ language went a great length from the original “C with classes” thing. But C++ inherits most of C's syntax and basic concepts like memory. If you have some spare time and would like to learn a bit of history this is a great book for that.
🌍 Web resources#
- cppreference.com - this is a complete online reference for C++ (and C) language and standard libraries. It is the most visited and referred resource about C++.
- C++ Core Guidelines - this is an initiative started by Bjarne Stroustrup and Herb Sutter. A set of guidelines and good practices to help write safer, better code. Not sure which of the existing fundamental options to choose, check with these guidelines.
- compiler-explorer.com, godbolt.org, gcc.godbolt.org - an interactive compiler explorers. No need to set up many environments in your dev machine anymore to test certain code on multiple computers and platforms.
- isocpp.org - a good way to learn what is going on in c++ community, like publication of recent videos, books or articles or new libraries.
This is not a full list of resources, but rather a good starting point for beginners in C++. You will come up with your own list of links and books once you start programming yourself. Good luck in your journey, I hope you will enjoy it!
🥰 Thanks to Sergei Nikitin for reading drafts of this!