3 ms·
Personally I'm not sold on Kotlin. I don't think it offers much for me over Java 17. Maybe nullable types? But I haven't had problems with null in years.
by vips7L 5y ago
Personally I'm not sold on Kotlin. I don't think it offers much for me over Java 17. Maybe nullable types? But I haven't had problems with null in years.
- deepsun 5y agoIt'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.
- adra 5y agoI'm a long term java dev and just recently moved to Kotlin for some new core services. To be honest I just find them complementary. Kotlin breaks anything it likes and it's basically the pre-bleeding edge that java needs. Everything that java adds to the language and the JVM are rolled into Kotlin to make the runtimes faster/robust/stable.