Object.eq is ready for discussion

Brendan Eich brendan at mozilla.com
Mon Sep 6 12:29:16 PDT 2010


On Sep 6, 2010, at 9:51 AM, Mark S. Miller wrote:

> For those perturbed by "freakishly short names"[*] it is long enough. It is even more clearly distinct from the existing equality constructs than any of "eq", "egal" or "equals". And most of all it is correct. Object.identical(x,y) implies that x and y are observably indistinguishable. An equally accurate choice would be "indistinguishable" but I don't like it. For one thing, Object.indistinguishable(x,y) is too long for a construct we should encourage.

> 
> [*] I do not understand this objection. So my second choice remains "Object.eq".

No offense, freakishly short was in relation to the other names in the standard. We don't find too many abbreviations after "eval", especially in ES5. As noted, we get some long names that are hard to shorten, and some shorties ("keys", notably) that are hard to lengthen even if they seem named according to a different naming philosophy.

Specifically, nouns such as "keys" and "values" make for short names, but most of the names in the standard library are verb-and-object-noun-phrase kinds of names.

"eq" is a fine name in a vacuum, but against the prevailing naming conventions, plural, it doesn't fit.

/be


More information about the es-discuss mailing list