Re: addEventListener and side effects (was: CfC to change Sensor approach, not progress current draft)

Le jeudi 22 mars 2012 à 10:27 -0700, Doug Turner a écrit :
> On Mar 22, 2012, at 10:20 AM, Dominique Hazael-Massieux wrote:
> > Le jeudi 22 mars 2012 à 10:09 -0700, Doug Turner a écrit :
> >> I am worried about consistency.
> > 
> > I agree that consistency is important; but between consistency and doing
> > the right thing, I think the latter takes precedence.
> I don't think I agree as the 'right thing' isn't defined.  Sorry.

I've pointed at a discussion showing that at least the HTML5 editor and
the DOM Level 4 editor thought that having side-effects to
addEventListener was not the right thing.

> > I'm all for striving for consistency when two equivalent
> > solutions exist, but if the addEventListener-with-side-effect is
> > considered an inferior solution, I don't think we should push
> > consistency with that approach.
> I hope it is clear that I do not think
> addEventListener-with-side-effect is an inferior solution.  So, this
> is really the gist of our argument, isn't it?

It is (if you ignore my point about accuracy).

Now, if you're correct that it is not an inferior solution, I'm all for
going your way: it's simpler, and more consistent with an existing
well-deployed API.

But I think it would be useful to get confirmation from others that it
is indeed not inferior: it would be a waste of time to invest energy in
something that has been pointed as problematic in other contexts.


Received on Monday, 26 March 2012 09:49:04 UTC