3 ms·
Developing now 80% in Kotlin and 20% in Java (on backend), I really think the main advantage of Kotlin over Java is nullability. You can use @Nullable/@NotNull
by jicea 6y ago
Developing now 80% in Kotlin and 20% in Java (on backend), I really think the main advantage of Kotlin over Java is nullability. You can use @Nullable/@NotNull annotations in Java, but nullability being a part of the type system in Kotlin is better. I also love being able to create simple functions and add extension methods to existing classes. But still, nullability is the strongest advantage of Kotlin and I don’t see how Java will address it.
- ragnese 6y agoAgreed about nullability. And Java will never fix it fully or I'll eat my hat. ... but, you have to be pretty damn good to win out over the native language of a platform. And if it were just Kotlin today vs. Java 16, I think Kotlin is a much nicer language, but it doesn't really differentiate itself that much. Sure, it's syntax is much nicer, but you still basically have the same semantics as Java. You have classes; everything is a reference; no const/immutable data; no (good) general way to clone things; you have the same-ish type system with inheritance and interfaces, but no type classes; still have weird shit like sized numeric types with over/underflow; exceptions for error handling; etc. At least Scala has monads and type classes, so you can say it actually has some expressability that Java truly doesn't. I'm not sure that Kotlin has that. Clojure is a totally different beast that really doesn't directly compete over Java devs, IMO. It just happens to use the JVM as a platform.
- roguas 6y agoYup, clojure people have no love for jvm. It's a source of libraries, period.