Hacker News new | ask | show | jobs
by marcosdumay 1778 days ago
The reason people confuse "==" and ".equals" in Java is because they are confusing. In general, Java doesn't use the concept of pointers, and yet, one of its main operators does.

That language feature is simply broken, and this is really not the same situation of confusing "a == b" with "a in b" or "type(a) == type(b)". One can say that comparison with None is Python is broken too, but the situation is much better because you get an error if you make a mistake, instead of your program misbehaving.

Javascript, by the way, is way worse than Java here. In general the language does not differentiate a number from a string with a numeric value (something I imagine it copied from Perl), yet a lot of features do.