3 ms·
That's why I think Kotlin is going to clean up. It's a language specifically designed to be commercially successful by providing you with a better Java. For ins
by mike_hearn 11y ago
That's why I think Kotlin is going to clean up. It's a language specifically designed to be commercially successful by providing you with a better Java. For instance this line of code:
data class Person(var name: String, val age: Int)
compiles down to a JavaBean with getName/setName type methods, a getAge but no setAge (val is immutable), an equals, a hashCode, a toString and a few other useful methods as well like copy() which lets you create clones of the object with any fields modified.
So with Kotlin you get many of the benefits of C# and some features that C# is only just introducing now, or in its next versions, but it all interops seamlessly with Java.
- matmo 11y agoCan you override the autogenerated setters and getters in Kotlin?
- lmm 11y agoI think it will fail in the same way as Xtend or (to a certain extent) perl. It puts too much focus on one-off productivity features which results in an inconsistent language with loads of edge cases, and it doesn't have any compelling "you can't do this in Java" selling points, just a bunch of minor syntax sugar. Ceylon has all the advantages of Kotlin, but put together a lot more coherently, and with a really compelling fundamental feature (union types).