4 ms·
Wow, so much negativity here O.o Kotlin is getting rapid adoption in the Android community and is quickly getting the same status as Swift has in the iOS world
by izacus 10y ago
Wow, so much negativity here O.o
Kotlin is getting rapid adoption in the Android community and is quickly getting the same status as Swift has in the iOS world.
The main reasons for the rapid adoption are:
- It's designed to easily integrate into existing Java codebases. This means that starting to use Kotlin is pretty much a case of adding two Gradle dependencies and source files into `src/kotlin`. Interop with Java is painless and doesn't require any special boxing as opposed to some other languages.
- It's standard library is small (~700KB), which is a stark contrast to Scala and some other JVM languages, which pretty much demand usage of ProGuard while developing due to large method count.
- It's performance characteristics are close to Java and doesn't cause catastrophic GC collection issues like some Clojure code does.
- It has pretty much all the features expected from a modern language (nullability, const values, concise syntax) while still keeping code very readable for people who already know Java. The adoption in our Java codebase has thus been rather painless, since code doesn't do any additional magic you wouldn't expect.
- It compiles code to Java bytecode which runs on Java 6 JVM, which is critical for Android.
- It has first-party support in IntelliJ IDEs, which includes Android Studio itself. The IDE experience is significantly better than Scala or Clojure one and almost on par with Java.
So in short, we got a modern language, which is easy to transition to from Java 6, gives seamless interoperability with existing Java code (you can just start writing Kotlin classes in your Java code base), doesn't add overhead to your Android application and doesn't behave strangely performance-wise. There are still some warts to fix (mostly related to static checkers), but Kotlin has been a huge win for Android world.
- Razengan 10y ago> quickly getting the same status as Swift has in the iOS world. What's keeping Swift itself from eventually becoming the preferred language for Android as well?
- izacus 10y agoThe fact that it would have to talk to Android via JNI bridge like C/C++/Go and other languages that don't compile to JVM. And the fact that there's no standard library outside the Apple world for the language. Adoption of Swift makes pretty much no sense, technologically or politically.
- kmiroslav 10y agoIt's a non starter as the main language since it's not JVM based. As a C/C++ alternative for native development on Android... possibly. This will be in great part decided by 1) How frustrated native Android developers currently are with C/C++ (I don't have the feeling they are much) and 2) How much resources Apple will dedicate to make Swift viable on Android (hard to imagine they would be that interested helping out the #1 player in that space while their #2 spot is shrinking on a daily basis).
- premium-concern 10y ago> - It's standard library is small (~700KB), which is a stark contrast to Scala and some other JVM languages, which pretty much demand usage of ProGuard while developing due to large method count. A Scala Hello World is around 30 kB, it can get more as you keep using more of the standard library, but to be realistic, it's around a few hundred kBs. Not sure what's the big deal with ProGuard it's just a deployment detail. Compilation seems to be faster with SBT and ProGuard than Java/Kotlin/... without ProGuard.
- rbjorklin 10y agoYou seem to know a few bits about Kotlin. I'm not well versed in Java land but why target Java 6 that's been unsupported for the last 3 years? Isn't that a problem?
- izacus 10y agoBecause the VM on Android devices runs only Java 6 compatible bytecode.