

Web Developer Admits: Objective-C Beats HTML5 - jesskah
http://engblog.polyvore.com/2012/12/web-developer-admits-objective-c-html.html

======
hayksaakian
Right tool for the right job and all that jazz.

We don't need more flamebait like the OP.

~~~
jonathantrevor
One of the points I was trying to get through, and perhaps didn't do a great
job of, was that I keep seeing people/apps trying to use HTML and various
wrapping frameworks / toolkits to create the look and feel of an iOS app. Even
worse, many of these "apps" don't even need to be apps (end of the article).

We went this route too and hoped we could re-use lots of code we already had
but, as you say, the right tool for an iOS app is Objective-C. Un-JITed JS
inside a wrapped app with a zillion Objective-C stubs using the DOM in a view-
like manner its not meant to represent just doesn't do it.

------
chrisringrose
Beats it in how easy it is to create, yes. But HTML5 is cross platform, and if
done properly, the speed differences are not noticeable to the human eye.

In fact, "Fastbook" is proof that an HTML5 app can be FASTER than it's iOS
counterpart. [http://www.sencha.com/blog/the-making-of-fastbook-an-
html5-l...](http://www.sencha.com/blog/the-making-of-fastbook-an-html5-love-
story)

Check out their video. They literally duplicated the iOS functionality, and
made it faster, with HTML5.

~~~
pooriaazimi
> _HTML5 done properly_

I've seen Gmail.app on a friend's iPhone 4S (with dual-core A5) and it's
slower than Apple's Mail.app on my sister's iPhone 3G (with a 300MHz ARMv6,
which I think is under clocked to 230MHz or something like that).

When Google (king of the Internet and HTML5) fails to "do HTML5 properly",
then the rest of us really don't have much chance.

(and, no, it's not (entirely) UIWebView's fault. If Google were allowed to use
Nitro or V8, Gmail.app would be 40% faster. But that iPhone 5's CPU is like 20
_times_ faster than that crummy old iPhone 3G)

~~~
chrisringrose
An email app like Mail just download and keep offline copies of most of the
mail. Opening the app and it instantly shows the pre-downloaded stuff. Yes, so
in that sense, the mail app is faster. Bravo.

The 40% faster boost takes us into the range of not-really-noticeable. If
there were a dev tool to make efficient HTML5 apps just like there is to make
native, and this speed difference was in miliseconds, not seconds, developers
will flock to HTML5.

~~~
pooriaazimi
I have to disagree. I didn't mean that Mail.app "shows stuff" faster because
it's cached the data and there's no roundtrip to the server (BTW, Gmail.app
does this too). I meant the animations, scrolling and general speed with which
"things" happen after you touch something or swipe.

And as I said, even if HTML5 rendering gets 40% faster, it's still extremely
slow compared to native UIKit stuff. HTML5 is like 3 times slower than UIKit
if you have any animation (and by animation, I don't mean really fancy stuff
even - even moving a rounded rectangle from point A to point B).

It's not this drastic on Android, but iOS's graphics stack has been heavily
optimized so _a lot of_ stuff happens in layers in GPU. UIWebView, because of
its implementation, does (almost) all its renderings in CPU and almost by
definition, is much, much slower than anything that's GPU-accelerated (and
takes at least 50% more memory and power).

The difference is like night and day. Open Gmail.app in iPhone 4S or 5 (the
new Gmail.app that was released a few weeks ago is faster than previous
versions though), and open Mail.app in an iPhone 3G. You'll see the difference
clearly.

~~~
chrisringrose
But I don't. I just loaded up gmail.com on the iPhone, and its nearly
flawless. If I click the "show all folders" button, it seamlessly swings over.
No lag, no jittery animation.

In fact, I use the built-in Mail app all the time. Loading gmail via IMAP in
this Mail app is actually _slower_ than the Gmail.com web app. For example, if
I enter a subfolder I've created (labels), and haven't entered it in a long
time, there's a considerable lag on the Mail app, and 1 second wait in the
Gmail.com web app.

(iPhone 5 BTW)

------
jayfuerstenberg
I loved this quote: "The best way of creating that awesome app is not to
insulate yourself from the power of the operating system you are running on
but to embrace it."

------
yuhong
Personally I think "HTML5" is a misnomer even as a buzzword. Better to compare
a specific browser instead.

------
Executor
Title should be renamed to "native code beats html5". I'd rather program in
html5/js than obj-c anyday!

~~~
jonathantrevor
Its not really a question of what you'd prefer to code in (you'll always
prefer something familiar) but what delivers the best result for what you're
trying to do. In essence we created two real, not test, apps, one using HTML
and one using Objective-C. The clear winner was Objective-C in our experience,
at this time. Creating a great mobile interface using HTML5 is certainly worth
doing and can be done - but I dont think it should be made to look and feel
like an app (either in safari or wrapped) since the "not-quite-right" issues
just keep piling up, and if you want the look and feel of iOS you should just
go native in the first place.

