ES accessor usage guidelines (Was: Map/Set.prototype.size)

Alex Russell slightlyoff at google.com
Wed Oct 17 07:15:03 PDT 2012


I agree (unsurprisingly) with Arv and Yehuda on this. Side effects are what
make the world go 'round. Getting overly prescriptive here is just a way to
box us into [not]using some particular stylistic form when designing
API...and I don't see how that settles any interesting questions. I'd much
rater we have debates as they arise about what is most
idiomatic/performant/etc. We can use the weight of precedent to inform
those discussions, but I'm pretty shocked that we would want to converge on
hard/fast rules about accessors.


On Tue, Oct 16, 2012 at 9:12 PM, Erik Arvidsson <erik.arvidsson at gmail.com>wrote:

> On Mon, Oct 15, 2012 at 12:23 PM, Brendan Eich <brendan at mozilla.org>
> wrote:
> > * get/set accessor may have effects on 'set' (see the DOM) but only on
> the
> > receiver object (and unobservably, any children that become garbage, e.g.
> > when trimming .length on an array-like).
>
> That is very limiting, even as a guideline. Any time there are two or
> more related objects it is very likely that a setter might affect some
> other object.
>
> --
> erik
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121017/7bbfe31f/attachment.html>


More information about the es-discuss mailing list