C++ has been around for so long that dinosaurs probably wrote their own game engines in it before the asteroid hit.
But here we are in the era of C++ 20 and C++ 23, and boy, things have changed.
From its humble beginnings in the 1980s, where C++ was basically “C but with more pain,” to today, where it’s “C but with even more features (and also more pain),” it’s been quite the ride.
ποΈ A Brief History of C++
- C++ 1.0 (1985): It was like C, but object-oriented. Nobody knew what that meant, but they were excited anyway.
- C++ 98/03: Introduced the STL (Standard Template Library), which was great but also made error messages longer than a Tolstoy novel.
- C++ 11: Auto, smart pointers, lambdas, and “modern C++” were born. Devs cheered, then promptly forgot half the features.
- C++ 14/17: Refinements and some cool new features like structured bindings. Not revolutionary, but nice.
- C++ 20: Concepts, coroutines, ranges, and the infamous spaceship operator. π
- C++ 23: More improvements, std::expected, and better constexpr support. At this point, C++ can probably write its own code.
1οΈβ£ “Hello, World!” (Classic vs. Modern)
|
|
|
|
π Comparison: Syntax hasn’t changed, but modern C++ drops unnecessary boilerplate like return 0;
.
2οΈβ£ Auto Magic
|
|
|
|
π Comparison: Auto removes the headache of typing variable types.
3οΈβ£ Ranges in C++ 20
|
|
π Comparison: This makes C++ feel more like Python!
4οΈβ£ Coroutines in C++ 20
|
|
π Comparison: Python had async/await for years, now C++ has it. Better late than never!
5οΈβ£ Spaceship Operator (<=>) in C++ 20
|
|
π Comparison: It makes comparisons easier than in Java and Go.
π₯ C++ vs. C#, Python, Go, and Java
Feature | C++ 23 | C# | Python | Go | Java |
---|---|---|---|---|---|
Performance | β‘β‘β‘β‘β‘ | β‘β‘β‘ | β‘ | β‘β‘ | β‘β‘β‘ |
Ease of Use | π | π | π | π | π |
Memory Safety | β | β | β | β | β |
Coroutines | β (new!) | β | β | β | β |
Compile Time | π’ | ποΈ | π | π | ποΈ |
π Takeaway: If you need raw speed, C++ still wins. But if you value your sanity, maybe check out C# or Python.
πThoughts
C++ has come a long way, from a clunky extension of C to a modern language with powerful features.
C++ 20 and 23 introduce features that make it feel more high-level, but it still retains its “you better know what you’re doing” philosophy.
If youβre a C++ dev like me (since 1987 :) ), embrace these new features. If youβre new to C++, wellβ¦ good luck.