3 ms·
C++ was accidentally highly expressive. Since it was accidental, much of this expressiveness was only available via convoluted and inscrutable metaprogramming.
by jandrewrogers 3y ago
C++ was accidentally highly expressive. Since it was accidental, much of this expressiveness was only available via convoluted and inscrutable metaprogramming. Nonetheless, this expressiveness turned out to be highly useful in practical scenarios, which established the value of that expressiveness.
If you fast-forward to C++20, metaprogramming is mostly, though not always, concise and easy to follow. The language was redesigned to make template hacks that people found highly useful into first-class features of the language. For reasons of backward compatibility, you can still express these things the old ways. But it isn’t required anymore, there are concise and direct ways of expressing most metaprogramming things you might want to do.
The extreme expressiveness of modern C++ in application domains with unusual requirements remains its greatest strength. For pure systems languages, nothing else can express as much in a type-safe way in so few lines of code, almost entirely due to its metaprogramming facilities.