4 ms·
>It sounds like you just want... regular classes? I don't understand your position here. Immutable data structures have many uses and are quite popular. If that
by Rebelgecko 7y ago
>It sounds like you just want... regular classes? I don't understand your position here. Immutable data structures have many uses and are quite popular. If that's not what you want, why use these at all?
Records provide a lot of syntactic sugar that classes don't (which is the whole reason to use them— there's nothing stopping you from creating a regular class with all final fields).
edit: I'm assuming that the "finality" of fields in records is identical to the shallow finality of a final field in an object