Skip to main content Accessibility Feedback

The cost of JavaScript in 2023

One of my favorite articles on the web is Addy Osmani’s the cost of JavaScript. He writes an update every year, but the one I tend to quote is from 2018.

Addy released a talk last month on the cost of JavaScript in 2023, and it contains a ton of great updates and new information based on big industry shifts and device trends over the last five years.

One of Addy’s main talking points is what he calls “the uncanny valley of JavaScript.”

This is that weird state in JavaScript-driven apps where the HTML is loaded and fully visible, and the app appears ready to use.

But because all of the interactions are JavaScript-driven and the JS hasn’t loaded yet, tapping and selecting things does nothing. It’s an incredibly frustrating and confusing thing for users.

Here some of my own quick observations from the talk…

  • Hearing Addy describe all the “advancements” that help improve performance on these heavy JS-driven apps feels massively convoluted and over-designed, and an absolute nightmare to maintain. Its one of the reasons why I love the Lean Web so much!
  • Just like with accessibility, it’s cheaper and easier to build something performant from the start. He compares reining in your JS on a 6-month old project to trying to sweep water back into the ocean.
  • Many developers fixate on optimizing for the network, or say things like, “Once the JavaScript is downloaded, it’s cached and costs nothing.” But the bigger constraint today is actually hardware and CPU limitations, especially on mobile devices. There, more JavaScript is always worse, cached or not.
  • An old iPhone 8 is more performant than newer low-end phones (same is true for M-chip Macs vs. typical computer). And for many, many people, the web is experienced on new-but-low-end mobile devices.

A majority of Addy’s talk is spent discussing various challenges and how to address them. I highly recommend watching the whole thing.

And if you want to learn how to use far less JavaScript and take full advantage of what browsers off out-of-the-box, sign up for a free account over at the Lean Web Club.