4 ms·
You should try Kotlin. It solves exactly this pain point - creating classes for data structures is very terse and easy. You can have a one-liner class like
by realharo 8y ago
You should try Kotlin. It solves exactly this pain point - creating classes for data structures is very terse and easy.
You can have a one-liner class like
class Person(val name: String, val email: String, val yearOfBirth: Int? = null)
Or you can make it a `data class` and get automatic `equals` and other things.
- sbalea 8y agoConcepts borrowed (in a simplified form) from Scala.
- worldsayshi 8y agoThank you for telling me. I've been hovering around this possibility since I'm using Intellij and am the primary owner of the code. Although I'm also keen on this code being as accessible as possible for the rest of the organisation and few has even heard of Kotlin. When I suggest switching to Kotlin everyone's always smiling dismissively like "ah, you with your crazy ideas again". Might do it though. Maybe.
- ben509 8y agoDon't ask, do it. Asking is a great way to get shot down. Write something smaller in Kotlin, then show people what it looks like. It is heavily interoperable with Java, so you could move some of the boilerplate heavy classes over.