W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2007

[whatwg] Asynchronous database API feedback

From: Benjamin West <bewest@gmail.com>
Date: Sat, 15 Dec 2007 18:00:45 -0800
Message-ID: <8ad71be30712151800q12421fecx319567540c603e44@mail.gmail.com>
On Dec 15, 2007 5:36 PM, Benjamin West <bewest at gmail.com> wrote:

> It's unclear how this might affect developers using the offline API.
>
> Ben West
>

Thought I'd add that for many developers, the issues with asynchronous
APIs requiring callbacks are difficult to overcome.  The examples
shown so far have been simple procedural examples, which mainly
express a trivial stylistic difference.  Many javascript libraries use
object oriented methods, which require the use of closures to bind
callback methods to their owning objects (in order to not lose a
reference to 'this').  This turns out to be a fairly confusing
concept.  No pun intended. There is also a performance hit for using
this binding technique, although I don't know how it would compare
with the average time the UI would be blocked by synchronous
retrieval.

I suspect that for most typical uses on most typical runtimes, most
developers would choose to risk the performance hit of synchronous
access to the complexity of binding methods to their objects.  I
suspect this allows faster prototyping with a migration to more robust
and flexible code, as well.  It would be great if there was a way to
measure this.

Ben West
Received on Saturday, 15 December 2007 18:00:45 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:59 UTC