{Weak|}{Map|Set}
Andreas Rossberg
rossberg at google.com
Thu Sep 15 06:49:42 PDT 2011
On 15 September 2011 09:10, Brendan Eich <brendan at mozilla.com> wrote:
> On Sep 14, 2011, at 11:09 PM, Allen Wirfs-Brock wrote:
>
>> I would prefer ObjectMap (the keys are restricted to objects).
>
> Now that you point it out (again), I agree.
I don't. :) It is true to some extent that WeakMap is GC jargon -- but
as Mark points out, the normal use case for weak maps _is_ to ensure a
certain space behaviour closely related to GC. So why obfuscate the
very intent by purposely avoiding what is more or less standard
terminology for it (if slightly ambiguous)? If I was a programmer
looking for something like weak referencing in JS for the first time,
"weak" is what I'd be searching for. "ObjectMap" would be too generic
a name to catch my immediate attention.
/Andreas
More information about the es-discuss
mailing list