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

RE: IndexedDB: ordering sense of IDBFactory.cmp?

From: Israel Hilerio <israelh@microsoft.com>
Date: Mon, 10 Oct 2011 18:07:13 +0000
To: "Jonas Sicking (jonas@sicking.cc)" <jonas@sicking.cc>
CC: "jsbell@chromium.org" <jsbell@chromium.org>, "public-webapps@w3.org" <public-webapps@w3.org>
Message-ID: <F695AF7AA77CC745A271AD0F61BBC61E3F4C5F18@TK5EX14MBXC117.redmond.corp.microsoft.com>
On Monday, October 03, 2011 10:04 AM, Jonas Sicking wrote:
> 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
> 

Good catch!  This makes sense to us too.

Israel
Received on Monday, 10 October 2011 18:07:51 GMT

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