|
|
|
|
|
by vbezhenar
3325 days ago
|
|
Kotlin didn't change, the only difference is `trait` keyword replaced with `interface` keyword. But I'm not really getting this article. Inheritance is key principle of Object-Oriented Programming, throwing it away would be very stupid move. It could be abused, but everything could. Kotlin solves this in pragmatic way: if you need inheritance, you must declare it explicitly. If you want delegation, Kotlin got you covered with awesome delegate syntax. The choice is up to you. Also remember that good compatibility with Java is a big priority for Kotlin, so inheritance works very similar to Java and compiles to the same obvious JVM structures. |
|
https://en.wikibooks.org/wiki/Scala/Traits
Or, in another example, how does use of Rust impl map onto Kotlin?
http://www.jonathanturner.org/2016/02/down-the-rabbit-hole-w...
I really don't mean this as a criticism of Kotlin, I'm just trying to map this all out. Kotlin seems nice and like something I could use, but I'm sure it has its boundaries also.