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

Re: [UndoManager] Re-introduce DOMTransaction interface?

From: James Graham <jgraham@opera.com>
Date: Fri, 06 Jul 2012 10:46:27 +0200
Message-ID: <4FF6A5E3.6060004@opera.com>
To: public-webapps@w3.org
On 07/06/2012 02:01 AM, Ryosuke Niwa wrote:
> On Thu, Jul 5, 2012 at 4:27 PM, Ojan Vafai <ojan@chromium.org> wrote:

>> In your version, you need to remember the order of the arguments, which
>> requires you looking it up each time. If we do decide to add the
>> DOMTransaction constructor back, we should keep passing it a dictionary as
>> it's argument. Or maybe take the label and a dictionary as arguments.
>>
>
> That's true of almost all other Web APIs when used in ECMAScript 5. I'm not
> sympathetic to the argument that you have to remember orders in which
> arguments appear because that's true of all functions in ES5, C++, and
> various other programming languages.

That just isn't true. Many web APIs solve the lack of named arguments in 
javascript by accepting an object with arguments. For example both 
jQuery and prototype use this pattern in their XHR APIs. Insofar as it 
doesn't follow this pattern, DOM is very much the odd one out. But in 
fact we already realise that having many positional arguments is a bad 
pattern, hence dictionary types.
Received on Friday, 6 July 2012 08:46:58 GMT

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