3 ms·
It's just a syntactic sugar. E.g. allowing last functional parameter to be specified after the closing parentheses makes possible to create interesting structur
by deepsun 5y ago
It's just a syntactic sugar. E.g. allowing last functional parameter to be specified after the closing parentheses makes possible to create interesting structures that look more like config file than procedural code.
But in general it's just the same Java, e.g. you would search for "how to do that in Java", not "in Kotlin".
- NoSorryCannot 5y agoKotlin has more compilation targets than Java, so I don't know that you can say that.
- deleted 5y ago[deleted]
- zorr 5y agoIt started out that way but in my eyes it has evolved to much more than just syntactic sugar. While Kotlin closures, receiver arguments, "it", extension functions, nullability operator, var/val, "when" pattern matching, sealed classes and smartcasts are mostly implemented as syntactic sugar, combining all of the above enables some interesting programming patterns. Some examples are Compose for building reactive/functional UI and TornadoFX for declarative UI on top of JavaFX. Coroutines and suspend functions provide structured concurrency and an async paradigm that interopts well with the "old" Java CompletableFuture apis and existing libraries. Kotlin Flow is the answer for observability and rx-like reactive programming. Kotlin multiplatform (while still in early development) allows sharing code between JVM, web and native targets (even iOS) with a decent-ish build system. I'm very bullish on the future of Kotlin and have been using it for years as my goto language for backend apis, MPA's, Android and JVM desktop projects. I'm excited to expand that into some combined web/iOS/android/desktop projects in the very near future.