3 ms·
I would argue that Kotlin brings massive benefits over Java 12: * Excellent null safety enforced by the type system * Data classes reduce boilerplate and b
by dtech 8y ago
I would argue that Kotlin brings massive benefits over Java 12:
* Excellent null safety enforced by the type system
* Data classes reduce boilerplate and bug sources
* Extension methods
* Declaration site variance removes a lot of the ? extends T
* Everything being an expression (if, switch/when) is powerful
* Smart casts are useful, especially when combined with subtypes and when (switch)
* Removal of checked exceptions
* Inline functions, a good way to work around runtime type erasure
* Properties, no more getX or setX
None of these are the killer reason to go over to Kotlin or another JVM language, but all combined they make building software much more efficient. Java could get all of these, but they've tried to increase feature delivery speed multiple times by adjusting release schedule and failed so far.
- pjmlp 8y agoI give it 5 years time for Kotlin to be having beers with Scala, Clojure, Groovy, Beanshell, Ceylon, XTend in terms of global JVM developer market share (I do not count Android as part of JVM market). https://trends.google.com/trends/explore?geo=US&q=java,kotlin,scala,Clojure https://trends.google.com/trends/explore?geo=US&q=java,kotli... Specially since JetBrains decided that they not only want to go against Java, they are also positioning Kotlin agoainst JavaScript, TypeScript, WebAssembly languages, C, C++, Rust, .... Ergo choosing multiple fronts to focus on. Which already has the consequence that Kotlin/Native code does not fully follow the same semantics. Also regardless of what people in HN think, Eclipse still rules the enterprise and the Kotlin plugin is a bit meh playing catchup with latest features. Most IT departments won't sign off InteliJ licenses just because some devs think Kotlin is cool. It is not language feature bullet points that make an eco-system, specially for those that don't own platforms.