As to the justification, I would say it's beneficial to use a dict when you
have string keys and you want to be able to use dot property access.
Constantly having to use map.get(key) and map.set(key, value) is overly
verbose if you're using string keys.


On Tue, Jan 8, 2013 at 3:24 PM, Domenic Denicola <
[email protected]> wrote:

>  In addition to Brandon's points, it seems to me a clear win from the
> "say what you mean" angle.
>
>  ------------------------------
> *From:* [email protected] [[email protected]]
> on behalf of Axel Rauschmayer [[email protected]]
> *Sent:* Tuesday, January 08, 2013 15:13
> *To:* es-discuss list
> *Subject:* Rationale for Dict?
>
>   Playing devil’s advocate: Is Dict really necessary? Whenever
> performance doesn’t matter (as much), I’d advocate Map. Otherwise, I’d
> expect programmers who want the extra speed to be comfortable with
> Object.create(null).
>
>  Assumptions about Dict:
> - You still can’t use the key '__proto__'.
> - You can’t invoke any methods on it.
>
>  How will it implement the iteration protocol?
>
>           --
>  Dr. Axel Rauschmayer
>  [email protected]
>
>   home: rauschma.de
> twitter: twitter.com/rauschma
>  blog: 2ality.com
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to