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: Julien Richard-Foy <julien@richard-foy.fr>
Date: Tue, 30 Aug 2011 19:39:36 +0200
Message-Id: <8D87FA17-593E-49C7-93A8-64A0BDD72D9E@richard-foy.fr>
To: Jonas Sicking <jonas@sicking.cc>
On 30 août 2011, at 18:07, Jonas Sicking <jonas@sicking.cc> wrote:

> On Tue, Aug 30, 2011 at 2:32 AM, Julien Richard-Foy
> <julien@richard-foy.fr> wrote:
>> 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.

Sure, have a look to these links:
http://en.m.wikipedia.org/wiki/Immutable_object
http://ofps.oreilly.com/titles/9780596155957/FunctionalProgramming.html

But that's not so important. If you just add traversing methods to NodeList it would be a huge improvement.
Received on Tuesday, 30 August 2011 19:22:45 GMT

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