Lesson 05 min read

Why Learn C++?

Game engines, browsers, and trading systems β€” when performance is everything

C With Superpowers

C++ is what you get when you take C β€” the fastest, most dangerous language on the planet β€” and give it classes, templates, smart pointers, and a massive standard library. It was created by Bjarne Stroustrup in 1979 as "C with Classes," and it's been the go-to language for performance-critical software ever since.

If C is a manual transmission car, C++ is that same car with power steering, airbags, and a turbocharger. You still have full control of the engine, but you also have modern safety features when you want them.

The Performance King

C++ compiles to native machine code β€” just like C β€” with zero runtime overhead. No interpreter, no virtual machine, no garbage collector. But unlike C, you get zero-cost abstractions: classes, templates, and smart pointers that make your code safer and more organized without slowing it down.

This is C++'s core philosophy: you don't pay for what you don't use. If you don't use virtual functions, they cost you nothing. If you don't use exceptions, they add zero overhead. The compiler optimizes everything you write into the fastest possible machine code.

Hello World β€” Modern C++ Style

#include <iostream>
#include <vector>
#include <algorithm>
int main() {
std::vector<std::string> languages = {
"C++", "Rust", "Go", "Java", "Python"
};
// Sort alphabetically
std::sort(languages.begin(), languages.end());
for (const auto& lang : languages) {
std::cout << lang << std::endl;
}
return 0;
}
Output
C++
Go
Java
Python
Rust

What Is C++ Used For?

C++ powers the software where speed isn't optional β€” it's the whole point:

  • Game Engines β€” Unreal Engine (Fortnite, PUBG), CryEngine, id Tech. AAA games are C++.
  • Web Browsers β€” Chrome (V8 engine), Firefox, Safari's WebKit β€” all C++.
  • Operating Systems β€” Windows, macOS, parts of Linux β€” all use C++.
  • Databases β€” MongoDB, MySQL, LevelDB β€” written in C++.
  • Finance β€” High-frequency trading systems where microseconds equal millions of dollars.
  • Compilers β€” Clang, GCC's C++ frontend, the LLVM toolchain β€” built with C++.
  • Embedded & Robotics β€” Self-driving cars, drones, medical devices.
  • Graphics & VFX β€” Pixar's rendering tools, Adobe Photoshop, Blender β€” all C++.

Modern C++ Is a Different Language

If you've heard horror stories about C++ β€” manual memory management, cryptic template errors, undefined behavior β€” those are mostly about old C++. Modern C++ (C++17, C++20, C++23) is a fundamentally different experience:

  • Smart pointers β€” unique_ptr and shared_ptr manage memory automatically. No more new/delete.
  • Range-based for loops β€” for (auto& item : collection) instead of iterator gymnastics.
  • auto keyword β€” Let the compiler figure out the type.
  • Lambdas β€” Inline functions that capture variables from their scope.
  • std::optional, std::variant β€” Safe alternatives to null and unions.
  • Concepts (C++20) β€” Constrain templates so error messages actually make sense.

Smart Pointers β€” Memory Safety Without a GC

#include <iostream>
#include <memory>
struct Player {
std::string name;
int score;
Player(std::string n, int s) : name(n), score(s) {
std::cout << name << " created" << std::endl;
}
~Player() {
std::cout << name << " destroyed" << std::endl;
}
};
int main() {
// unique_ptr: automatic cleanup, no memory leaks
auto player = std::make_unique<Player>("Alex", 100);
std::cout << player->name << ": " << player->score << std::endl;
// player is automatically destroyed here β€” no delete needed!
return 0;
}
Output
Alex created
Alex: 100
Alex destroyed
Note: C++ has a steep learning curve β€” there's no sugarcoating it. The language is huge, with decades of features stacked on top of each other. But you don't need to learn all of it. Start with modern C++ (C++17+), use smart pointers, avoid raw new/delete, and lean on the STL. The 20% of C++ you use daily will cover 95% of what you need.

The Job Market

C++ jobs tend to be high-paying and specialized:

  • Game Developer β€” Unreal Engine, custom engines, performance-critical gameplay systems.
  • Systems Programmer β€” OS kernels, drivers, firmware.
  • Quant / HFT Developer β€” High-frequency trading. C++ devs in finance earn top-tier salaries.
  • Graphics / Engine Programmer β€” Rendering engines, shaders, GPU programming.
  • Embedded Engineer β€” Automotive, aerospace, robotics, IoT.
  • Infrastructure Engineer β€” Databases, compilers, browsers, cloud infrastructure.

Who Uses C++?

  • Epic Games β€” Unreal Engine, one of the biggest game engines in the world.
  • Google β€” Chrome, TensorFlow's core, search infrastructure.
  • Microsoft β€” Windows, Office, Visual Studio, Azure infrastructure.
  • Adobe β€” Photoshop, Premiere Pro, After Effects β€” all C++.
  • Bloomberg / Citadel / Jane Street β€” The finance world runs on C++.
  • Tesla β€” Autopilot and self-driving systems use C++.

Quick check

What is C++'s core philosophy regarding performance?

Continue reading

Variables & Data Types β†’