jQuery primacy points to mobile issues

Mobile platform strategist Peter-Paul Koch held a JavaScript library poll and has now published the results. As you might expect, jQuery was dominant, but it was also revealed that a whopping 95 per cent of respondents used libraries, and most (75 per cent) considered mobile performance acceptable when using existing libraries. Only half (47 per cent) said they considered micro-libraries a better approach than full-scale libraries like jQuery.

We asked Koch if the dominance of JavaScript libraries could lead to issues, such as devs and designers relying on them and not testing sites without JavaScript. “The problem is not testing, and also not the library size, but the CPU time and energy – and thus battery life – that it takes to initialise the library,” he said, citing Who Killed My Battery: Analyzing Mobile Browser Energy Consumption (PDF). Within, a test is described where Wikipedia pages are loaded with jQuery for accordion functionality, and with a small, custom-built script that does the same. The first case drains the battery much more than the second, because jQuery has to be initialised. “Basically what we're looking at here is that the cost of syntactic sugar is too high on mobile, and that we need a new set of libraries that go light on generic features and just do what they need to be doing so as to avoid a costly initialisation process.”

According to Koch, jQuery has become so dominant because of its age and also its accessibility to novices through documentation and community support. The large user-base has subsequently led to more plug-ins, in turn leading to more users. “But this is a problem,” he argued, “because fewer and fewer people now bother to actually learn JavaScript, which is what we need for the mobile web.” He said existing libraries simply aren’t good enough for mobile: “Even on high-powered devices, current libraries are a drain on the battery, and on low-powered devices we have the additional problem that the CPU is slow and initialising the library takes ages.”

Thank you for reading 5 articles this month* Join now for unlimited access

Enjoy your first month for just £1 / $1 / €1

*Read 5 free articles per month without a subscription

Join now for unlimited access

Try first month for just £1 / $1 / €1

The Creative Bloq team is made up of a group of design fans, and has changed and evolved since Creative Bloq began back in 2012. The current website team consists of eight full-time members of staff: Editor Georgia Coggan, Deputy Editor Rosie Hilder, Ecommerce Editor Beren Neale, Senior News Editor Daniel Piper, Editor, Digital Art and 3D Ian Dean, Tech Reviews Editor Erlingur Einarsson and Ecommerce Writer Beth Nicholls and Staff Writer Natalie Fear, as well as a roster of freelancers from around the world. The 3D World and ImagineFX magazine teams also pitch in, ensuring that content from 3D World and ImagineFX is represented on Creative Bloq.