To class, or to data class, that is the question

Whenever we write a new class in Kotlin, we may feel tempted about defining as a data class. But should every class which is a data holder be a data class? I don’t think so. During the last months I have seen suggestions in PRs such as “make this class a data class?”.

Kotlin data class

--

--

Impure developer and functional programming enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store