3 ms·
> How people could write "public virtual bool Equals(object other)" Well it was created before generics in .NET one and can't be removed, that's the simple ans
by alkonaut 3y ago
> How people could write "public virtual bool Equals(object other)"
Well it was created before generics in .NET one and can't be removed, that's the simple answer. But yeah, making object equality customizable virtually was probably the worst design mistake in C# and .NET. Having to specify the comparer explicitly when creating e.g. a Set collection would have been so much better for quality.
The second worst mistake was defaulting CultureInfo to the system culture (i.e. making methods like float.Parse()/ToString() take the system culture into consideration instead of requiring everyone to pass in the required behavior)