4 ms·
> "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 c
by 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.