3 ms·
Identity vs Equality isn’t unique to JS. It’s particular syntax isn’t even unique either (though less common). Protypical inheritance goes back to the damn Act
by abritinthebay 9y ago
Identity vs Equality isn’t unique to JS. It’s particular syntax isn’t even unique either (though less common).
Protypical inheritance goes back to the damn Actor pattern and modern versions (like JS) derive from Smalltalk.
The particular implementation of this in JS is idiosyncratic to JS but not conceptually unique. They improved it a LOT with strict mode too.
I swear, most JS criticism on HN seems to sound like developers who only know C++/Java/Ruby/Python critiquing stuff that comes from the Lisp/ALGOL/Smalltalk idioms and not understanding that the way they are used to isn’t the One True way.
- saghm 9y agoI think framing JavaScript's equality semantics as merely "identity vs. equality" glosses over the issue people have with it, namely that the semantics of equality themselves are somewhat inconsistent (e.g. `3 == "3" => true, `3 == "3 "` => true, `"3" == "3 "` => false, or `null > 0` => false, `null == 0` => false, `null >= 0` => true). This isn't to say that these semantics are objectively wrong (although the lack of transitivity in the former does stretch the definition of "equality"), but I don't think it's really that surprising that some programmers aren't fond of them. As for things like prototypical inheritance, `this`, and other language features not being distinct to JS, I'll concede that point. However, I still think my main point stands, namely that criticisms of JS aren't just blanket criticisms of "interpreted languages".