3 ms·
How would inheritance, mutability and an arbitrary, presumably wrong and misguided "copy method" be a feature?
by HelloNurse 6y ago
How would inheritance, mutability and an arbitrary, presumably wrong and misguided "copy method" be a feature?
- unscaled 6y agoWhy do you think copy methods are "presumably wrong and misguided"? For the rest, I agree that in 99% of the cases inheritance and mutability are not needed if you're using greenfield Kotlin libraries. But they are unfortunately often necessary in the Java world. Mutable data classes are especially quite useful for reducing boilerplate when creating classes that implement the Fluent Builder pattern, which is unfortunately quite necessary if you don't have a copy method...