Hacker News new | ask | show | jobs
by mike_hearn 3807 days 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.

2 comments

I 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).

Can you override the autogenerated setters and getters in Kotlin?