Hacker News new | past | comments | ask | show | jobs | submit login

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.




Since 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: