set.delete method name

Adam Shannon adam at ashannon.us
Tue Feb 28 11:49:00 PST 2012


I agree that it should be named "remove" rather than delete.

On Tuesday, February 28, 2012, Yehuda Katz wrote:

> Just catching up on this discussion. I should point out that this problem
> applies to Map and possibly other collections as well.
>
> Speaking as someone who is looking to use these features today, I hit this
> problem immediately. Ember.js already has a Map; we can reliably generate a
> unique id for any object (by stashing it on the object; ok for our cases),
> and have a reliable way to generate guids for non-Objects.
>
> Ideally, we'd like to be able to say something like: `if(typeof Map !==
> "undefined") { Ember.Map = Map; }` (although we'd probably do more checks
> because shims in general have worse performance characteristics).
>
> Unfortunately, because of the `delete` problem, we cannot do this. Because
> we are unwilling to monkey-patch Map directly, we will have to create a
> shim object that delegates to the Map.
>
>  I'm sympathetic to the "let's not make choices based on old broken
> browsers", but let's be fair here. The name `remove` is perfectly clear. In
> five years, nobody is going to think twice about that API, and web
> developers won't think twice about it today. Using a clear name that also
> happens not to run afoul of older browsers for shim purposes isn't caving
> to the past: it's being pragmatic about helping people adopt a new feature
> with very little cost.
>
> Yehuda Katz
> (ph) 718.877.1325
>


-- 
Adam Shannon
Developer
University of Northern Iowa
Sophomore -- Computer Science B.S. & Mathematics
http://ashannon.us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120228/a188d1c6/attachment.html>


More information about the es-discuss mailing list