3 ms·
Can't understand the need for records when C# solves the problem of boilerplate with regular classes and some syntactic sugar.
by dmitriid 7y ago
Can't understand the need for records when C# solves the problem of boilerplate with regular classes and some syntactic sugar.
- Kipters 7y agoIt's an easy and zero-boilerplate way to have immutable data-only structures with some useful tidbits like structural comparison, meaningful hashcodes etc. I say this as a C# developer that would desperately want them supported in C# and was super pissed off when they were discarded from C# 8.0 (I actually need them right now, they would save me a whole day of typing today)
- vbezhenar 7y agoApparently immutable classes in a functional streams is a new hotness and nobody uses POJOs anymore. They'll slap pattern-matching on top of that, to complete the circle. I completely agree as I, myself, see very few instances where I could use records in my code. But properties to remove getter/setter boilerplate? That would remove thousands of LoC. But it's not hot. Fashion-driven development, that is.