W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2013

Re: URLQuery / FormData

From: Anne van Kesteren <annevk@annevk.nl>
Date: Tue, 10 Sep 2013 00:15:25 +0100
Message-ID: <CADnb78j8R7cu=RNZko9DpNOdf6pLEiE1de8+gP1eu-+X-sKerg@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: "public-script-coord@w3.org" <public-script-coord@w3.org>
On Mon, Sep 9, 2013 at 11:31 PM, Jonas Sicking <jonas@sicking.cc> wrote:
> obj.get(name)
> returning the first value.
> obj.getAll(name) or obj.getMulti(name)
> returning an array.

The problem with this is that then get and delete are no longer
describing similar kinds of operations. get only operates on the first
matching value. delete operates on all matching values. set would
under your proposal operate on the first value and destroy the rest.
Or would it take an array of values as well?

The mismatch between get/delete seems wrong and makes the API hard to
understand. That's why I proposed the change.

> Ddestructuring doesn't really help here since it produces parsing
> errors in downlevel clients and has to live in separate <script>s.

The future is longer than the past.

> I can live with names other than 'set' if that is the controversial
> bit. I don't understand why there's all this resistance to creating an
> API which is compatible with existing JS APIs though? The DOM going
> its own way and using a "not invented here" approach has always seemed
> like a bad thing to me.

I don't understand what you mean here.

> As far as I can tell it should be possible to make this object fully
> compatible with a Map.

It seems fundamentally incompatible with a Map. E.g. a Map does not
support checkboxes.

Received on Monday, 9 September 2013 23:15:52 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:18 UTC