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 the 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.
sudo apt-get update
sudo apt-get install build-essential -
Install CMake
sudo apt-get install cmake -
Install an IDE (Integrated Development Environment) and an 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.
-
Read the following two links on how to create an C++ project with CMake, how to do Builds, how to Run and to use the Debugger:
Visual Studio Code C++ Quick Start
Quick start to CMake -
Study the video on C++ from Derek Banas on youtube that summarizes the main features of the programming language.
C++ Tutorial 2019 -
Read the following small book on C++ from the inventor of C++, Bjarne Stroustrup. This book is updated with the Standard C++ 17. 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 -
Read this book of general programming techniques with C++.
Programming: Principles and Practice Using C++ 2nd Edition by Bjarne Stroustrup -
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
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++.
Best regards,
Joao Nuno Carvalho