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

IndexedDB: ordering sense of IDBFactory.cmp?

From: Joshua Bell <jsbell@chromium.org>
Date: Mon, 3 Oct 2011 09:30:05 -0700
Message-ID: <CAD649j7GrUMZ=_fAY+rw51=6ZtV0z9NatWitPxuzvFFFRJQh7g@mail.gmail.com>
To: public-webapps@w3.org
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.
Received on Monday, 3 October 2011 16:30:40 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC