W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Re: [selectors-api] Return an Array instead of a static NodeList

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 30 Aug 2011 09:07:53 -0700
Message-ID: <CA+c2ei_qP9qhvK3in+YnzoNqXwi6eDckB40jcgYW5TgRRO4woQ@mail.gmail.com>
To: Julien Richard-Foy <julien@richard-foy.fr>
Cc: Aryeh Gregor <ayg@aryeh.name>, public-webapps@w3.org
On Tue, Aug 30, 2011 at 2:32 AM, Julien Richard-Foy
<julien@richard-foy.fr> wrote:
> On Aug 30, 2011, at 10:33 AM, Jonas Sicking wrote:
>> My point was that it was a mistake for querySelectorAll to return a
>> NodeList. It should have returned an Array. Sounds like people agree
>> with that then?
>
> I think itís better to return an immutable object (mutable objects are source of programming errors). But this immutable object should have traversing method (forEach, map, filter, etc.).

Can you explain how mutable objects are a source of programming
errors. It seems that javascript made the choice a log time ago to use
mutable objects and settable variables, as opposed to for example
haskell.

/ Jonas
Received on Tuesday, 30 August 2011 16:08:50 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:47 GMT