Function Properties in Data Classes are Code Smells
To me, using functions as properties in the primary constructor of a data class is a code smell. Here’s why: Data classes represent data. Data is a value. Data is never executed. Functions are not data. They produce values when executed. Note: By the book, a function returns a value, while a procedure executes commands. In both cases, neither is data. Why It Matters Kotlin generates key methods for data classes based on the properties in the primary constructor, such as:...