3 ms·
But that’s not the C++ way! /s In reality, C++ is insanely complicated, and you’d be right about needing to avoid “wankage”, but sum types make sense sometimes
by colejohnson66 6y ago
But that’s not the C++ way! /s
In reality, C++ is insanely complicated, and you’d be right about needing to avoid “wankage”, but sum types make sense sometimes. But the C++ committee refuses to do what I would consider sane and implement pattern matching. Instead, they gave us `std::visit` and all the confusion that goes along with it.
- ncmncm 6y agoPattern matching is under development. It's not an easy thing to get right. C++26 will probably have pattern matching, and then sum types will have better support. In the meantime, they might not always be the best solution. Everyone complains about C++ complexity, and also about all the features they think should be added. But each new feature makes the language more complex. The language is the wrong place to measure complexity. Complexity people experience directly is in programs, instead. A well designed language or library feature makes programs simpler and more understandable. Obsolete language features fall out of use, and rarely occupy our thoughts. Mainly, when we find obsolete features in programs, that dates the code, and helps us know what to expect.