W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: IndexedDB: ordering sense of IDBFactory.cmp?

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 3 Oct 2011 10:04:01 -0700
Message-ID: <CA+c2ei-QqarFq5zDLTO1S_DmCpaExkPKKhtAGMf7txzHqe=xig@mail.gmail.com>
To: Joshua Bell <jsbell@chromium.org>
Cc: public-webapps@w3.org
On Mon, Oct 3, 2011 at 9:30 AM, Joshua Bell <jsbell@chromium.org> wrote:
> As we're implementing IDBFactory.cmp in WebKit we noticed that the
> ordering sense is reversed compared to C's strcmp/memcmp, Perl's cmp/<=>
> operators, etc.
> As currently spec'd, IDBFactory.cmp(first, second) returns 1 if first
> < second
> C's memcmp/strcmp(first, second) return -1 if first < second
> Perl's (first cmp second) and (first <=> second) operators return -1
> if first < second
> Java's first.compareTo(second) returns < 0 if first < second
> .NET's String.Compare(first, second) returns < 0 if first < second
> We're wondering if this will be a usability issue with the API, if there's
> a good justification for this seemingly inverted ordering, and if it's not
> too late to reverse this in the spec.

I don't recall any particular reason for the current order. I suspect
it was simply a mistake.

I'm all for reversing order.

/ Jonas
Received on Monday, 3 October 2011 17:04:58 GMT

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