3 ms·
It's not so much Javascript itself that is the issue so much as the reliance on HTML/CSS for the UI. iOS (and recent versions of Android) are designed around th
by nodamage 11y ago
It's not so much Javascript itself that is the issue so much as the reliance on HTML/CSS for the UI. iOS (and recent versions of Android) are designed around the performance limitations of their devices (especially on early hardware), and there are a lot of optimizations in their respective UI frameworks to ensure the UI stays responsive, and scrolling stays smooth, even when working with large amounts of data.
Throwing the kitchen sink at developers in the form of HTML/CSS does not encourage performant design, and indeed when you read stories of developers trying to write complex mobile apps using web technologies it often eventually devolves into a performance optimization game (that doesn't always succeed).
That said, I'm sure someone could put together a UI framework based on JS that rivals the perormance of iOS or Android. But no one has bothered to do so because they view HTML/CSS as "good enough". Which is critically flawed thinking.
- pcwalton 11y agoThis is closer to the mark: implementations of CSS cause a lot of problems. CSS isn't obviously worse than mobile frameworks though. In fact, I'm getting fairly confident that CSS can potentially achieve better performance than UIKit and the Android stack (because it's parallelizable and declarative as opposed to procedural, neither of which apply to mobile app frameworks), though of course browsers of today don't take advantage of this well. Another large issue is that browser implementations of CSS are a black box: very few Web developers understand how it works and browsers present a hidden maze of slow paths. (Which CSS animations will run in the compositor? Which run a separate thread? What events cause off main thread scrolling to be disabled? What order will the browser fire events in?) This is, again, an issue that's more about implementation more than anything: I believe a better from-scratch implementation of the CSS specs would fix a lot of this.