Web Platform

You’ve got to think for yourselves.

You are all individuals.

I hate when technical debates turn into religious wars. Today’s war on tap? Progressive enhancement.

For anyone who hasn’t heard the ruckus, here’s a quick summary:

  • Progressive Enhancement (PE) became a term in 2003 and by 2008 became a best practice. It was a mantra chanted repeatedly, the same way CSS over tables was pounded into the minds of every web developer. Here’s a nice history/overview.
  • Within the past couple of years, as browsers have gotten better, single-page applications have gained a lot of traction, completely abandoning the page request model and rendering all html client-side.
  • Many proponents of PE, noticing the trend, have written/presented about why it is still important.
  • On August 27th 2013, a tumblr called Sigh, JavaScript was launched “reminding” people that PE is still important by posting images of sites that don’t work without JavaScript.
  • On September 2, 2013, Tom Dale (from ember.js) posted an article declaring PE “dead”. Despite the article’s controversial and hyperbolic title, it was (IMHO) actually fairly balanced and well reasoned throughout.
  • Chaos ensued on twitter and the rest of the web.

There have been some other summary posts trying to provide their own insight. Here’s mine:

I think the information presented by both sides is far more valuable than the conclusions they reach. They both have compelling arguments, and they both have good examples to support their case, but as I hope we’ve all learned time and again, you should never use dogma in place of actual thought. If you look at the data and arguments presented, I think you can actually come away with valuable guidelines when making decisions, but despite opposing conclusions, I think the guidelines compliment each other well as long as you keep context in mind.

If you have content that you want deep linkable, especially something as small as a tweet, you damn well better be able to load the page fast. What is the fastest way to do that? Serving the html for initial page load is pretty damn good at it. This is probably not just tweets, but news articles, blogs, recipes, etc. However, even if you go that route, remember that you’re making an argument from a position of efficiency/good user experience. And guess what, there’s a million other things that go along with that. What are you doing about ads? What about number of http requests, etc. Serving html and enhancing is just one tool in the arsenal for faster web apps. I will also go out on a limb and say that it’s not really the original point of PE.

The efficiency argument has another flaw I haven’t seen get much attention too – if you’re going to delay rendering until after JavaScript runs to prevent the dreaded FOUC, then in terms of efficiency, the argument is basically dead right there, at least for the cases where the progressive enhancement actually has to update the DOM before rendering. In both cases the browser has to wait until all of the JavaScript is loaded and executed before rendering anything. Sure it will work without JS turned on, but that is a different argument than the efficiency one.

So what about the other argument for PE? What about no JavaScript? PE started as a movement because of the potential lack of JavaScript by the client – which (as they always push home) also means google! This was the PE argument that Tom Dale was mostly railing against in his post. He posits that the userbase with JavaScript turned on is high enough that if you want to use 100% JavaScript, that’s ok, especially if you don’t care about google. I found his argument logical and sound. The web platform has grown up a little. JavaScript can be expected for a wide enough audience, that you can now make the case for ignoring the few with it turned off. It may not be for everyone, but it is an extremely valid choice – one which can be made more often. It is the choice that we made for Octane.

The way I see it, one of the most powerful features of the web platform is how flexible it is. Some kind of html rendering is available on almost every electronic device or platform with a screen. That is a virtue of the web, not a contract. The logic that all software available online has to be usable from all possible devices is clearly false. Not all software is made to work that way, and not all software that can be made to work that way is. So where is the line? And what exactly is the boogie man we are attempting to fight off with PE that it should be “ingrained in the DNA of anyone who works on the web“. Is it a morality argument or simply a business one? As “Sigh, JavaScript” demonstrates (unintentionally), there are clearly many successful businesses with websites that don’t work without JS. As for morality, with the exception of resources such as government websites, I have trouble finding the moral argument.

Is PE dead? No. Is it necessary for all projects that can do it? No. In some projects, is it a requirement? Yes. For the rest, it is an optimizaion. It is like choosing to create a native app for blackberry or windows 8. It is a competitive advantage to be able to reach users in more places. In some cases, it could be hugely important to some of your users. Ultimately, though, the goal is to make the best product you can, and you will always have to make hard choices about the best way to do that. It will always be a balance. Add a new feature or make the product faster? Fix a bug or improve documentation? Improve the UI or support IE7? These aren’t dichotomies, they are priorities. The amazing thing about the web is that with enough time, you might be able to do it all, but how you get there is up to you.