3 ms·
I like Kotlin and would probably use it but I just couldn't get over the lack of list / map literals. Seems like they never could figure out how to get them to
by zmmmmm 4y ago
I like Kotlin and would probably use it but I just couldn't get over the lack of list / map literals. Seems like they never could figure out how to get them to mesh with the static typing. It's just too useful to be able to write nested structures cleanly and simply inline for ad hoc / exploratory analysis.
- deepsun 4y agoI use listOf(), setOf() and mapOf(). Longer than literals, right, but not by much. And for exploratory .filter{} and .map{} are much better than Python's awkward map(lambda x: ...) and filter(lambda x: ...).
- zmmmmm 4y agoyes, they are fine at top level, but they fall apart when you try to nest them unfortunately (lists of maps of lists etc ... ). In groovy / javascript / python these just look completely natural.