Hacker News new | ask | show | jobs
by rgoulter 941 days ago
> ADTs

C++ is already a very complex beast as it is.

ADTs (and pattern matching) make it concise to express many different programming things.

But I'd imagine that adding it to C++ would be horrendous.

1 comments

Well, they already did [0]. It's not very fun to use; something that was less miserable would probably see more use. Retrofitting them to a language isn't impossible, either; there are a few languages that have managed to do it by adapting to their ecosystem's mores, like TypeScript and Kotlin.

That beings aid, I don't disagree with your general point. C++ is already incredibly complex and impossible to understand as a single individual; I don't think that can be fixed without removing things from the language.

My gut feeling is that the future of C++ is not C++, it's cpp2 or Carbon.

[0]: https://en.cppreference.com/w/cpp/utility/variant