2 ms·
.net could have made equality entirely optional; and it could have exposed machinery to implement equality (including all aspects of it!) by composition, not ma
by emn13 10y ago
.net could have made equality entirely optional; and it could have exposed machinery to implement equality (including all aspects of it!) by composition, not manual fiddling - at least not by default!
That would have made .net less memory-hungry, faster, less bugprone, and simpler.
There's absolutely no good reason for this horribly complicated and inefficient state of affairs; not all platforms/languages suffer from these limitations. As you point out, even F# manages to do better despite the considerable extra limitation of needing to maintain some sort of compatibility even at runtime with the current crazy state, and despite what is certainly a much more limited development budget.
- hvidgaard 10y agoIn hindsight there is a lot they should have done differently. Immuteable by default and not nullable by default are two of the obvious. But they where targeting Java developers, so they couldn't just bring a completely different language to the market. They had to be a better Java.