36 ms·
> Optionals were a 2-case enum the entire time Why the drama, of course it is, what else what it be? The same is true for other languages, eg Scala.
by coin 2y ago
> Optionals were a 2-case enum the entire time
Why the drama, of course it is, what else what it be? The same is true for other languages, eg Scala.
- bena 2y agoI really don't know what else. I believe this is how dotnet implements them under the hood as well. I don't need the Optional to be "not an enum", I need it to function in certain ways. And syntactic sugar is 0 calorie. Add as much as you want. I don't care that "return x ?? y;" expands to "if (x == null) { return y; } else { return x; }" That's what it does. Math itself is essentially syntactic sugar for language to express manipulation of numbers.