W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2011

addEventListener and side-effects

From: Robin Berjon <robin@berjon.com>
Date: Tue, 6 Sep 2011 13:41:22 +0200
Message-Id: <5EF6E3C2-313F-4E0D-B45D-5A8E310B934F@berjon.com>
Cc: public-device-apis@w3.org
To: www-dom@w3.org
Dear www-dom,

as most of you are probably aware, there have been recent threads on both the Geo list[0] and the DAP list[1][2] about calls to addEventListener producing side-effects (or purported side-effects).

In both cases we have a situation in which registering an event using addEventListener() is said to immediately (but asynchronously) trigger an event for the given event type. The advantage is clear: it provides the author with immediate information about (respectively) device orientation and battery status, without requiring one to encumber the API with an extra method just to get information that is expected to be otherwise provided through events. However there is disagreement about whether such behaviour constitutes a side-effect that reaches beyond what event registration ought to perform or not. I will leave it up to the threads and proponents of each position to provide further details as needed since this humble spectator of the debate clearly sees the value that this design brings to authors and their primacy as a constituency but fails to grasp the exact architectonic expostulations brought to bear against it.

Since both discussions appear to have been inconclusive, and since the issue is likely to crop up again in other similar APIs, we would like it to be put to rest. And www-dom seems to be the right place for that.

[0] http://lists.w3.org/Archives/Public/public-geolocation/2011Jul/thread.html#msg9
[1] http://www.w3.org/mid/23D6BB2B-2E52-4DB3-960F-A6D245E497F3@nokia.com
[2] http://www.w3.org/2009/dap/track/issues/113

Trackbot: this targets DAP-ISSUE-113 and DAP-ACTION-448.

Robin Berjon - http://berjon.com/ - @robinberjon
Received on Tuesday, 6 September 2011 11:41:56 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:18 UTC