4 ms·
"Sum types". Hey, let's give an old concept a new name. Those are called discriminated variant types, and they first appeared in Pascal. They're a straightforw
by Animats 9y ago
"Sum types". Hey, let's give an old concept a new name. Those are called discriminated variant types, and they first appeared in Pascal. They're a straightforward concept, and can be implemented easily at the language level.
The big problem with C++ is that the template fanatics took over. Templates are a crappy programming language - bad syntax, confusing semantics, and tough debugging.
But there's no way to stop people from extending the language via templates. Hence Boost, and "you are not supposed to understand this" templates.
(I fear that Rust is going down the same rathole.)
- jnbiche 9y ago> "Sum types". Hey, let's give an old concept a new name. Sum type has been the standard functional programming language term for this concept since at least the 1970s, perhaps earlier.