On Friday, 14 January 2022 at 22:48:42 UTC, Guillaume Piolat wrote:>
I don't think it's a valid criticism actually.
Not too many objects actually need to be all of the following: hashable, ordered, have a string representation, need ==.
If they need all 4, and they need it virtually, then pay the bytes.
In order to make a class work with associative arrays / hash tables, it will need to implement at least Hash and Equals. Similarly, any class that implements Ordered can and probably should implement Equals, too.
At the very least, Hash and Ordered should both extend Equals so that implementers don't have to waste another pointer on explicitly implementing Equals when it can be done implicitly just as well.