Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
AnimalMuppet
· 4y ago · 0 comments
==
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.
Comments
[–]
delta64
4y ago
How 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
OP
4y ago
True. But people
think
about it a bit differently. People don't always expect == to be a function call.
[–]
delta64
4y ago
Sure, but I think '== might be a function call' is a lot less confusing than '== sometimes compares for equal value and sometimes doesn't'