Some neat things with data clases (vs. e.g. Java's records):
- default values for parameters
- if you use vals, your data classes are immutable
- copy constructor that has the same parameters as the constructor with their current values as the default value.
- destructuring values
- extension and delegated properties. Those are not limited to data classes of course but they are really nice to use with data classes.
Kotlin multi platform and data classes are actually a nice combination btw. We have a spring boot project with a Kotlin multi platform API client that we can consume on Android, IOS, in a Browser and in our integration tests for the server. Exact same code working exactly the same way on IOS native, in a browser, or on Android and the JVM. It uses ktor client for http communication, and kotlinx serialization for json parsing. Works great.