3 ms·
I miss Swift enums when writing Kotlin. Kotlin enums are more restricted in that associated values can’t differ between cases, which limits their usefulness and
by jwells89 3y ago
I miss Swift enums when writing Kotlin. Kotlin enums are more restricted in that associated values can’t differ between cases, which limits their usefulness and means that much of the time what you want are instead sealed classes.
There’s actually several bits of Kotlin like this which feel somewhat pedantic/idiosyncratic and fussy if you’re used to writing Swift. I’m sure there’s valid design reasons behind these decisions, but sometimes it feels like unnecessary friction.
- deleted 3y ago[deleted]
- MrBuddyCasino 3y agoSince sealed class definitions can live in the same file and the syntax is quite compact, in Kotlin they don't annoy me as much as in Java.