== vs .equals() is pretty understandable considering that it's Java specific, and would be valid in most(?) other languages
== vs .equals() is pretty understandable considering that it's Java specific, and would be valid in most(?) other languages
In C, you can have value equality or pointer equality. Then, you have the whole "either write your own character-by-character comparison or learn which libraries to include to compare strings". There's also the detail of remembering what strcmp() returns.
I might be wrong since Python is not my daily driver, but "a is b" and "a in b" and "a == b" and "a == b and type(a) == type(b)" are all distinct from one another.
Javascript has strict equality and equality.
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.
And in VScode it isn't even possible to truly disable it!
The main reason I find myself second guessing this one is if you get used to the convention of other languages and then switch over to java.