HN user

alunny

181 karma
Posts4
Comments20
View on HN

re only affecting emulators: see @pmuellr's reply below - the bug in question affects 2.2 devices also. Since we're a community-driven open source project, you can see the discussion process :) http://groups.google.com/group/phonegap-dev/browse_thread/th...

Again, "such significant performance gains for our users" is just FUD when you're talking about arbitrary benchmarks. An app built using Forge and PhoneGap, providing the same functionality, with the same UI layer, would be a much better measure of that. I'd be happy to be proven wrong.

(disclaimer: I work for Adobe on a competing service (PhoneGap Build) and have worked with PhoneGap for years)

This is a silly benchmark - there is absolutely no reason you would put 1000 calls at once, sequential or parallel, across this sort of bridge in a real app. You probably shouldn't be calling any JavaScript API in a client-side app 1000 times at once.

The bridge in PhoneGap Android probably is slower than the one in Forge but

1) that's a tradeoff the PhoneGap devs were willing to make for wider compatibility, support for older devices, and isolation from the bizarre Android WebKit bugs that crop up in every release.

2) synthetic benchmarks aside, there's no indication this would affect the usability of the app.

Take the camera example in the article. A PhoneGap call (judging from the graphs) takes about 14ms, a Forge call about 3ms. That's for the entire round trip (JavaScript -> Native -> JavaScript), so divide each in half for each side of the trip.

With PhoneGap: * first half of the trip (7ms) * Android presents Camera activity, user picks a photo, Android returns control to original app (say, 500ms, very conservatively) * second half of the trip (7ms) = 514ms

With Forge: * first half of the trip (1.5ms) * Android presents Camera activity, user picks a photo, Android returns control to original app (500ms) * second half of the trip (1.5ms) = 503ms

This is much closer to a real-world use case - and the calls to native APIs entirely dominate the time spent on the bridge.

As I understand it, the main objection to `__proto__` is that it's writable, and thus not atomic with object creation. This creates a bunch of headaches for implementors for performance and security.

More knowledgable people than myself discuss it on this es-discuss thread: http://www.mail-archive.com/es-discuss@mozilla.org/msg06142....

There is a Harmony proposal for a "set prototype of operator" that would solve this problem; instead of writing:

    var newObj = {__proto__: OldObject, id: 5}
You would write:
    var newObj = OldObject <| { id: 5 }
Detailed here: http://wiki.ecmascript.org/doku.php?id=harmony:proto_operato...

The Underscore functions do exactly the same as Resig's in the simple case (when passed just an array of numbers). They're longer because they accept custom iterators for non-numerical arrays.

camelCase is the de facto standard for JavaScript - all of the DOM APIs and major libraries use it.

edit: oh, you probably mean the language name. Again, JavaScript is the correct formatting, even if it looks silly to most eyes.

The core of Node has very few functions that perform I/O, but there's no reason you can't use I/O in your own programs (in the original link, the network stream is read and written out, and also the blacklist file is read, synchronously). The readFileSync call is an anomaly in Node - typically you use evented I/O - open a stream and set listeners/callbacks for particular events.

There are modules developed for most of the major open source databases (I'm not sure what the status of the async MySQL driver is, but there's definitely something you can use).

> "Are you that great?". No, apparently he's not.

That's not really fair - there are plenty of very good motivations for writing (and reading) fiction other than immersion in a sustained imaginative world. By that criterion, "Avatar" is a better film than than, say, "Casablanca," because James Cameron knows more about the flora of Pandora than Michael Curtiz does about Morocco.

Adams is a great writer precisely because of his lack of pretension, his humility, and his irreverence -- I'd be disappointed if he didn't regard his own work with the same outlook he had for everything else.

WTFJS? 16 years ago

it's because of type conversion - null has the same value as 0 (as in `(+ null)`), so it is a number

Regarding PhoneGap specifically, which the book seems geared toward, for a short period of time Apple believed, erroneously, that the iPhone PhoneGap code was exposing unapproved APIs to developers, and were rejecting apps that used the platform. At that time, I think some devs were obfuscating PhoneGap and submitting the same apps, which were approved, so even then Apple were not objecting to anything actually in the iPhone PhoneGap code.

Apple have been in touch with PhoneGap devs since and clarified the matter; there's a good blog post here regarding that: http://nachbaur.com/blog/updates-on-apple-phonegap

Since then Apple have had a much more informed stance towards PhoneGap and have approved lots of apps using the framework (there's a list on the PhoneGap site).

*full disclosure - I work for Nitobi, who sponsor PhoneGap's development. Though the original link suggests using PhoneGap in its preface, there are competing platforms, such as Rhodes and Appcelerator, that also get through to the App Store.