[whatwg] Asynchronous database API feedback

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