The Name of the Name

David Herman dherman at mozilla.com
Wed Aug 1 15:56:30 PDT 2012


On Aug 1, 2012, at 3:44 PM, Brendan Eich wrote:

>> One possibility is :  moniker

While I recognize the benefit of staking out new territory, I think that misses the opportunity to build off of existing intuitions. I tend to think it's ok to use a term from another language that isn't 100% isomorphic, as long as a) the analogy helps people bootstrap their understanding, b) the core intuition suggested by the name is good, and c) the differences aren't likely to trip people up.

>> Consider:
>>  "A property key is either a string or a moniker"
> 
> I agree that "Name" here is confusing when one reads aloud, because the capital N and code font are not voiced. However in print, Name can work as well as Symbol or other terms.

I'm partial to Symbol. It doesn't smell like a thesaurus was involved, and it's a decent intuition. In the Lisp world, strings and symbols are isomorphic, but there's a sense that symbols have identity where strings don't. Now, Lisp symbols are historically forgeable and interned, so this isn't exactly the same concept. But you can still ride on the intuition that "symbols are like strings but they have identity / cheap comparison". And it feels like a smaller delta to the language to say:

    "A property key is either a string or a symbol"

rather than

    "A property key is either a string or a new-thing-you-haven't-heard-of"

(YMMV)

> It would be awkward to have only compound names such as UniqueName and PrivateName.

Yes, compound names feel like we're giving up. :) And I'd really rather unify unique/private into a single datatype with a privacy flag, rather than two separate datatypes.

> Hacker jargon such as a nouned "gensym" would be as distinctive, if not moreso, and better yet, well-employed compared to "moniker".

I could live with nouning gensym, even though some people are allergic to nouning/verbing. Then again, new Gensym does smack of the Kingdom of Nouns -- verbing a nouning of a verb, oh my! Or we could simply have a gensym() function -- uncapitalized -- and refer to the result as "a gensym." That's just a single nouning.

In a vacuum, I like the idea of "key" but that's obviously far too generic, and the term is already used by Object.keys(). I tried thesaurusing it but nothing jumped out at me.

Dave



More information about the es-discuss mailing list