Facebook: “Betting on HTML5 Was a Mistake” – Technical Reasons and Reactions
Facebook has decided to go native for mobile content instead of doing HTML5 as it was the plan for a couple of years. This article contains technical details behind FB’s move, and reactions from Xamarin and Mozilla.
Mark Zuckerberg, CEO of Facebook, has recently declared during an interview for TechCrunch that “the biggest mistake that we made as a company is betting too much on HTML5 as opposed to native because it just wasn’t there,” and “since we’ve done the iOS app we’ve seen double the amount of feeds people consume.”
Zuckerberg did not say exactly what was their problem with HTML5, but he suggested the quality of such products was not good enough: “There are mobile experiences out there that are so good, that … we need to have the highest quality, and the only way is doing native.”
Tobie Langel, a Facebook software engineer and W3C AC Representative, detailed in a post the performance issues encountered by Facebook while building a mobile web presence based on HTML5. The first problem Langel mentioned was the lack of debugging tools:
The lack of tooling in mobile browsers makes it very difficult to dig down and find out what the real issues are. …
The biggest issues we've been facing here are memory related. Given the size of our content, it's not uncommon for our application to exhaust the hardware capabilities of the device, causing crashes. Unfortunately, it's difficult for us to understand exactly what's causing these issues. GPU buffer exhaustion? Reaching resource limits? Something else? Hard to say.
Langel would like to know the memory usage for heap, objects, GPU buffers, and information on GC cycles, FPS, and other resource limits.
Inconsistent frame rates, UI thread lag (stuttering).
GPU buffer exhaustion due to size of content and number of images.
Native momentum scrolling has a different feel across operating systems. JS implementation end up being tailored for one OS and feels wrong on other ones (uncanny valley).
Perf issue with touch events on Android devices (latency, not enough events) which makes JS implementations of scrolling more brittle there.
Other issues mentioned by Langel were: the GPU, which comes as “a black-box”, the need for better touch tracking support on Android, smoother animations, and better caching. Some of these issues have already been submitted to the W3C Web Performance WG.
In a comment for InfoQ, Nat Friedman, CEO of Xamarin, maker of tools for building cross-platform native apps, welcomed Facebook’s move: “This shift to embracing native experiences is a great thing for the entire mobile ecosystem - device manufacturers, app publishers, and most importantly, consumers.” He also noted that it is too early for mobile standards to emerge:
Mobile innovation is still moving at lightening speed, far outpacing the velocity that a ‘standards’ approach can ever achieve. Historically when a new OS is introduced, the capabilities are so new that the only way to exploit them is at the OS level. The best apps and the most ground-breaking innovation at this stage therefore happen very close to the OS. This dynamic is very true for the current mobile device platforms. The race for market share is driving a tremendous amount of change and innovation at the device operating system level. Over the next several years, these operating systems will stabilize and innovation will slow at this level, making a standards approach more feasible. But this will take several years.
Brendan Eich, the CTO of Mozilla, an organization betting on web technologies, has a different take on Facebook’s failure with HTML5, according to ZDNet:
If you read between the lines, what it seemed he [Mark Zuckerberg] was saying is what they tried to do was hybridize native and HTML, and when you do that there's always a seam between the systems. A friend of mine, Joe Hewitt, used to be at Facebook and did the first hybrid app and did a very good integration. But he left, and the skill required to keep that seamless — and possibly some of the support from Apple to do it — weren't there in the later versions.
Eich is confident that the web will eventually win:
I don't think the web ever loses. It's just a matter of pragmatics and spin that you get into with these things. …
Companies like Facebook can afford to do a native [app], especially on iOS. But for the long tail, developers will generally do the web and often be content there.
If the web can be evolved to include the missing APIs and have better performance, [developers] won't need to go beyond the web. …
I have a feeling the web will be pretty darn good [10 years from now], and you won't have this tension between native versus web that we're endlessly debating these days.
Matt Asay, an editor for The Register, quoted an unnamed Facebook engineering manager saying on the native vs. HTML5 controversy:
Right now Facebook moves fastest by writing native code. This isn't to say HTML5 won't ever be able to live up to the hype, but just that at this point Moore's Law and the web engines still have some ways to go. So we made a pragmatic decision. Eventually if HTML5 lets us move faster you could expect to see us move back to it. We are going to use whatever tech stack lets us do high-quality work at a fast pace.
Mark Zuckerberg also thinks HTML5 is promising on the long-term:
And it’s not that HTML5 is bad. I’m actually, on long-term, really excited about it. One of the things that’s interesting is we actually have more people on a daily basis using mobile Web Facebook than we have using our iOS or Android apps combined. So mobile Web is a big thing for us.
Facebook released a native app for iOS in August and they are preparing a similar one for Android which is supposed to hit the Google Play store soon.
Enough of the "Web"
The Web solved important deployment and cross-platform issues 10+years ago, but the fact is, over 90% of the mobile devices sold today are either Android or IOS, in a world where every pixel, byte transmitted over 3G/4G and mA counts, in a world where people bring their client with them, in that world, except for some people who never wrote a mobile app, I don't see anyone who could seriously recommend HTML5, don't hold your breadth, there won't be many more in the future, just like there is pretty much no one who is using a "resource oriented" API model today.
The Web programming model is gone, it certainly taught me a lot, but I see no particular reason to stick to it today. Native developers have nothing to gain to move to HTML5.
Re: Enough of the
I am a big fan of native over HTML5 for the right reasons - it means encouraging a shift to linked data and "web of data" that's long been underplayed by the HTML zealots.
That said I think companies doing simple apps will be well served by just doing HTML5 . The FT.com site is an interesting counterpoint to the native trend. Companies whose whole business is through the Mobile Internet will want a native experience. Certainly there is debate as to which is more productive - at a higher level of complexity it's mostly a wash between multiple native clients and a big HTML5 site , but I'd bet for simpler stuff HTML5's portable libraries (jq mobile, sencha, etc) give a prouctivity edge.
Re: Enough of the
>> it means encouraging a shift to linked data and "web of data"
Data is relational, people have to learn how to live with it, there is no magic wand of any kind that will change that fact. We are again in this "magic bullet" mode, that only the few of the few can see. It would be helpful if people would deliver what they talk about before they actually talk about it, be it a resource-oriented programming model, HTML5 "apps" or the "web of data".
Now if you want to do a mobile "Web site", why not use HTML5? sure... but, the boundary between a site and app is disappearing rapidly, especially from a monetization perspective. In this day and age, you are either an app, a service or a platform. The way I see the Web (and Web sites) today is pretty much like I saw the Yellow Pages Phone Book in 1999.
End users decide what they want, this is the new normal, and I understand, some people have trouble to adjust to having lost the control they enjoyed for so long.
More detailed quote from Matt Asay's Register Article
" Facebook's approach to HTML5 has been hobbled by politics and a lack of expertise, both in HTML5 and in mobile. Zuckerberg is correct that today's HTML5 tools aren't perfect, but in this case the problem may lie more with the craftsman than with the tools."
Dmitriy Khmaladze and Leonid Ganeline Oct 13, 2015