Progressive enhancement is the Right WayTM to do things in web development. It works like this:
Write the HTML for your content, 100% semantically (i.e. only the necessary tags to explain the meaning of the content).
Style the HTML using CSS. You may need to add hooks to your HTML in the form of classes and ids for the CSS to target.
Parallel to this, the functionality of the site/app is progressively enhanced:
But of course you knew that, because that’s how you roll. I’m not sure this is the way forward though. To explain why I’ll need to start with a bit of (over-simplified) history.
A history lesson
Originally, most sites on the web were a collection of static HTML pages saved on a server. The bit of the URL after the domain gave the location of the file on the server. This works fine as long as you’re working with static information, and don’t mind each file having to repeat the header, footer, and any other shared HTML.
In order to make the web more useful, techniques were developed to enable the HTML to be generated on the fly, when a request was received. For a long time, this was how the web worked, and a lot of it still does.
Shifting to the client
No page reloads
If we’re trying to avoid page reloads, why not take that to its logical conclusion? All the server needs to do is spit out JSON – the client handles all of the rendering. Even if the entire page needs to change, it might be faster to load the new data asynchronously, then render a new template using this new data.
Working this way, a huge amount of functionality would need to be written twice; once on the server and once on the client. This isn’t going work for most people, so we’re left with two options – either abandon the “no reload” approach or abandon progressive enhancement.
The end of progressive enhancement
So, where does this leave things? It depends on how strongly you’re tied to progressive enhancement. Up until now, progressive enhancement was a good way to build websites and web apps – it enforced a clean separation between content, layout, behaviour and navigation. But it could be holding us back now, stopping the web moving forward towards more natural interfaces that aren’t over-burdened by its history as something very different to what it is today.
Or maybe not
I’m completely torn on this issue. I wrote this post as a way of putting one side of the argument across in the hope of generating some kind of discussion. I don’t know what the solution is right now, but I know it’s worth talking about. So let me know what you think!
Appendix: Tools for this brave new world
If anybody has any suggestions for other suitable libraries/frameworks I’ll gladly add them in here.
Edit: I’ve now written a follow-up to this post: The end of progressive enhancement revisited.