C++ is an old but evolving language. You can use it for almost anything and find it in many places. In fact, C++’s inventor, Bjarne Stroustrup, described it as the invisible foundation of everything. Sometimes, it might be deep inside a library of another language because C++ can be used for performance-critical paths. It can run in small, embedded systems or power video games. Your browser might be using it. C++ is almost everywhere!
C++ has been around for a long time but has changed significantly, particularly since 2011. A new standard, referred to as C++11, was introduced then, marking the beginning of a new era of frequent updates. If you haven’t used C++ since before C++11, you have much to catch up on, so where do you start?
Why C++ matters
The language is compiled and targeted at a specific architecture, such as a PC, a mainframe, an embedded device, bespoke hardware, or other things. If you need your code to run on various types of machines, you need to recompile it. This has pros and cons. Different configurations give you more maintenance work, but compiling to a specific architecture gets you "down to the metal", allowing the speed advantage.
Whatever platform you target, you will need a compiler. You also need an editor or integrated development environment (IDE) to write code in C++. ISOCpp gives a list of resources, including C++ compilers. The Gnu compiler collection (GCC), Clang, and Visual Studio all have free versions. You can even use Matt Godbolt's compiler explorer to try code on various compilers in your browser.
The compiler may support various versions of C++, so you have to state the version you need in the compiler flags, for example -std=c++23 for g++ or /std:c++latest for Visual Studio. The ISOCpp website has a FAQ section that gives an overview of some recent changes, including C++11 and C++14, and big picture questions. There are several books focused on later new versions of C++, too.
Where to start relearning?
If you've been left behind with C++, the plethora of resources might be overwhelming. The full-length article explores the following topics:
- Using Vector
- Class template argument deduction
This content is an excerpt from a recent InfoQ article by Frances Buontempo, "Relearning C++ after C++11".
To get notifications when InfoQ publishes content on these topics, follow "Programming Languages", "Development", and "Asynchronous Programming" on InfoQ.
Missed a newsletter? You can find all of the previous issues on InfoQ.
Multi-cloud: Must-have or mostly hype? We surveyed 300 engineers and architects across two continents to gain their on-the-ground insights from running multi-cloud deployments in production. The result? A report packed with unbiased, data-driven insights to inform your cloud strategy going forward.
Download now - sponsored by Cockroach Labs
QCon: For practitioners, by practitioners
QCon London (April 8-10): Last chance to secure early bird pricing. Book before December 12.
Get up-to-speed on the latest trends, techniques, and ways of working being applied by people just like you. Tracks at QCon include; software architecture, APIs, data engineering, leadership, cloud-native, AI/LLMs, platform engineering, mobile and frontend development, security, working effectively with teams, FinTech, and more!
Secure your spot by December 12 to save £500 off the full-price ticket. Register now!