The C# compiler requires that whenever a custom type defines operator ==
, it must also define !=
(see here).
Why?
I\'m curious to k
Well, it's probably just a design choice, but as you say, x!= y
doesn't have to be the same as !(x == y)
. By not adding a default implementation, you are certain that you cannot forget to implement a specific implementation. And if it's indeed as trivial as you say, you can just implement one using the other. I don't see how this is 'poor practise'.
There may be some other differences between C# and Lua too...