5 ms·
The Swift feature I miss in other languages is `enum` cases with parameters and `switch` blocks having to cover all cases, it's so convenient.
by wildpeaks 3y ago
The Swift feature I miss in other languages is `enum` cases with parameters and `switch` blocks having to cover all cases, it's so convenient.
- bsaul 3y agosame here. I don't understand how this feature hasn't landed in every other compiled languages (i'm looking at you golang)
- dwaite 3y agoBoth of these are also shared with Rust FWIW. I believe Swift takes the switch farther than match in Rust, because it tries to deal with API stability (e.g. a system library adding new possible cases)
- dontlaugh 3y agoProper sum types are so useful, it's a tragedy so many statically typed languages lack them.