Rabu, 12 September 2012

This Is Why HTML5 Was Facebook's "Biggest Mistake" and Why It Chose It in the First Place


Facebook is finally abandoning its grand plans to have all of its mobile apps built on a central HTML5 pilar. Facebook spent two years building the infrastructure and the technology to have all of its mobile apps share the same code.

But Facebook realized that it wasn't getting the performance it wanted, no matter what it did, so it abandoned plans and decided to go native.

In hindsight, Facebook's error, what Zuckerberg now calls their "biggest mistake," is obvious. Even the most inexperienced developer will tell you that native code is the way to go on mobile and very few go the HTML5 route.

Many of those that do soon realize that it's not working, except in a small number of specific cases.

But there was reason behind the madness, using an HTML5 core meant Facebook could repurpose it on any platform. It also meant it could update it instantly, for all platforms, without having to actually update the app.

It allowed Facebook the flexibility of the web within a native app. The drawbacks, unfortunately, are obvious to anyone that has used a Facebook app on any mobile platform, it's slow.

The engine powering HTML embeds in native app aren't always as powerful as the actual browsers on that mobile platform, case in point being iOS which uses a slower JavaScript engine for apps than it does in Safari.

Even when apps do get to access the same engine as the default browser, JavaScript is an interpreted language, meaning there are several layers of abstraction before you get to the actual processor. All those layers add overhead and slow down the computing process.

This is why there's been a huge focus on improving JavaScript engines in browsers in recent years, but JavaScript still can't compete with native languages on the desktop. At best, it's "good enough" and that's, well, good enough for many web apps. Most of those apps don't need any more processing power, don't need to be faster.

On mobile devices with limited processing capabilities, things aren't as clear cut. Native code will win the speed race with a major lead. There are very few cases where HTML5+JavaScript is going to be as good as native code on mobile. A complex app such as Facebook isn't one of them, even with Facebook's obvious engineering prowess.

Via: This Is Why HTML5 Was Facebook's "Biggest Mistake" and Why It Chose It in the First Place

Tidak ada komentar:

Posting Komentar