3 ms·
== should do the obvious thing. But with operator overloading, it's not clear that it does, unless you need to read the implementation of == very carefully.
by AnimalMuppet 5y ago
== should do the obvious thing. But with operator overloading, it's not clear that it does, unless you need to read the implementation of == very carefully.
- delta64 5y agoHow is that any different to some opaque method call? By the same logic `a.equals(b)` might be doing something funky under the hood
- AnimalMuppet 5y agoTrue. But people think about it a bit differently. People don't always expect == to be a function call.
- delta64 5y agoSure, but I think '== might be a function call' is a lot less confusing than '== sometimes compares for equal value and sometimes doesn't'