A guide to the adventurer
First to learn modern C++ you have to choose an operating system. The C++ is the same in all of them, but the settings and some libs used are different. In this guide I focus on the development in Linux, but the info can also be useful for other operating systems.
-
In this context we start by installing Ubuntu Linux, as a stand alone machine or as a virtual machine.
Ubuntu -
Install the Build Essential Tools on Ubuntu, they have the GCC compiler. You can also install CLang that uses LLVM instead.
sudo apt-get update
sudo apt-get install build-essential- Install CMake
sudo apt-get install cmake-
Install an IDE (Integrated Development Environment) or a editor, I choose Visual Studio Code to develop but also like to have Sublime Text to open a file quickly. Both work on Linux, Windows and Mac, and both are fast.
Visual Studio Code
Sublime Text -
In Visual Studio Code, install the following Plugins directly in the IDE (Square button on the left):
C/C++ ... syntax highlighting, code completion and debugging
CMakeTools ... to generate automatically the CMake files
CMake ... syntax highlighting and code completion for CMake files
Code Spell Checker... comments and code
Markdown All in One ... markdown syntax highlighting and preview
Better Comments ... TODO list's in code comments and more -
In youtube search and see some videos on how to use Visual Studio Code and explore the menus and buttons, including the shortcuts.
-
Read the following links on how to use the plugins in VSCode. How to create an C++ project with CMake, how to do Builds, how to Run and to use the Debugger, all inside VSCode:
Getting started with C++ in VS Code
CMake Tutorial -
Read the following on how to use CTest, to Unit Test your programs.
Testing With CMake and CTest -
Study the following to learn about C and CPP package managers. Conan and Vcpkg.
Vcpkg Vs Conan: Best Package Manager For C++
JFrog Conan Center
Conan documentation -
C++ linter - cppcheck
cppcheck - A tool for static C or C++ code analysis
Github cppcheck -
C++ Weekly with Jason Turner - Youtube Channel
C++ Weekly with Jason Turner -
Study this video on C++ from Derek Banas on youtube that summarizes the main features of the programming language.
C++ Tutorial 2021 -
Read the following small book on C++ from the inventor of C++, Bjarne Stroustrup. This book is updated with the Standard C++ 17 and talks a little bit of what would be C++20. This book was published before C++20. It has to be the second edition. While reading the book do many experiments with code from the book and make variations to the code in Visual Studio Code.
A Tour of C++ 2nd Edition by Bjarne Stroustrup -
Read the small book on GCC that is free on the net.
An Introduction to GCC: For the GNU Compilers GCC and G++ by Brian J. Gough, Richard M. Stallman -
Four good books on general programming with C++.
C++ Primer 5th Edition - C++11
by Stanley Lippman, Josée Lajoie, Barbara Moo
Programming: Principles and Practice Using C++ 2nd Edition by Bjarne Stroustrup, C++11 and C++14
C++ Crash Course - A Fast-Paced Introduction - C++ 17
by Josh Lospinoso
Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14
by Scott Meyers -
Read the following about design patterns.
Design Patterns: Elements of Reusable Object-Oriented Software
by Erich Gamma , Richard Helm and others
1994 -
Read the following free ebook to learn about algorithms.
Competitive Programmer's Handbook by Antti Laaksonen -
To really understand a programming language and the craft of programming, it's necessary to study large programs, how they are implemented, what where the options, what where the decisions, to study the program's architecture. If possible, the large program should be well documented and well made! The following free book and repository are an excellent example of the craft of programming of a large scale system with high performance.
"This book has deservedly won an Academy Award. I believe it should also be nominated for a Pulitzer Prize." -- Donald Knuth
Physically Based Rendering: From Theory to Implementation 3rd Edition by Matt Pharr, Wenzel Jakob, Greg Humphreys
Github with the project code -
Three good online references for the STL (Standard Template Library).
Microsoft C++ Standard Library Reference
C++ reference at cppreference.com
You can see it off line and alter it's CSS to make a dark mode in
https://en.cppreference.com/w/Cppreference:Archives
105 STL Algorithms in Less Than an Hour - CppCon 2018: Jonathan Boccara -
A good book on C++ concurrency.
C++ Concurrency in Action 2nd Edition
by Anthony Williams
If you do all this steps you will have a good knowledge of C++ and can start doing large problems in C++.
- You may be also interested in my guide on Rust.
How to learn modern Rust
https://github.com/joaocarvalhoopen/How_to_learn_modern_Rust
- The links to all my guides are in:
Guides on Linux - Programming - Embedded - Electronics - Aeronautics
https://github.com/joaocarvalhoopen/Guides_Linux-Programming-Electronics-Aeronautics
Best regards,
João Nuno Carvalho