4 ms·
Records are good, although in typical Microsoft style they've elected to call the new constructor syntax "positional" instead of "primary", and then subsequentl
by melolife 6y ago
Records are good, although in typical Microsoft style they've elected to call the new constructor syntax "positional" instead of "primary", and then subsequently failed to generalize the feature to normal classes.
With is just building on the anti-pattern where .NET programmers are too lazy to implement constructors.
- manigandham 6y ago> "With is just building on the anti-pattern where .NET programmers are too lazy to implement constructors." What? And aren't records just a lazy way to make classes then?
- melolife 6y agoThe new with-expressions are a concession to the existence of initializers, which are themselves literally "stuff that should have been in the constructor" and are incompatible with immutability (hence the new init property hack). The correct path would have been to require primary constructors for records as the only point of entry for data, declare initializers incompatible with primary constructors, and then just synthesize a method for creating copies - but hey, then you might as well just use Scala.
- aliswe 6y agoYou seem to not appreciate the prqcticality of immutability in a large system.
- melolife 6y agoQuite the opposite. My language of choice is Scala, which probably explains my frustration at Microsoft's consistent inability to do the right thing.