ES accessor usage guidelines (Was: Map/Set.prototype.size)
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>
> > * get/set accessor may have effects on 'set' (see the DOM) but only on
> > 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.
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss