Hacker News new | ask | show | jobs
by wildpeaks 1121 days 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.
3 comments

Both 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)

Proper sum types are so useful, it's a tragedy so many statically typed languages lack them.
same here. I don't understand how this feature hasn't landed in every other compiled languages (i'm looking at you golang)