3 ms·
If Android, then Kotlin, else Java. But on a serious note it’s far too complex of a decision that includes your personal situation. I have a mixed codebase of
by p2detar 3y ago
If Android, then Kotlin, else Java.
But on a serious note it’s far too complex of a decision that includes your personal situation. I have a mixed codebase of Java and Kotlin and I tend to prefer Java now. I do use Kotlin’s Data classes a lot though. That’s my favorite feauture of the language.
- kaba0 3y agoHow do they relate to Java’s records?
- p2detar 3y agoThey do have similarities, but data classes actually predate records. One can declare a data class a record by using the @JvmRecord annotation, which probably introduces some JVM benefits in how records are represented in the Java memory model. All in all you could use a Kotlin data class just like you'd use a Java record, but it gives you much more flexibility like inheritance and mutable fields.