Why did Twitter move away from being a single-page application?
My answer to Why did Twitter move away from being a single-page application? on Quora
Twitter is still a single page application, it’s just built properly now (one result of which is that you can’t easily tell).
When Twitter first went single page, the only way to do so while still maintaining functioning hyperlinks and a working back button was to use a vile hack involving fragment URLs—things like https://twitter.com/#!simonw/sta...
This works, but comes with a whole bag of downsides:
- Screen readers may fail to understand what’s going on.
- Only some search engines can index the pages, again using a nasty hack.
- These aren’t “real” hypertext URLs. If you perform a GET operation against them you don’t get the content the URL refers to, you just get the Twitter homepage. This is bad for the health of the Web.
These hashbang URLs are nasty, nasty hacks.
How does this fix the problems above? It means that Twitter can start serving real webpages again. Try running this command:
Dan Webb, an engineer at Twitter, wrote some very insightful pieces about this issue. In It’s About The Hashbangs (May 2011) he explained why he believed Twitter’s hashbang implementation was the wrong way to go. A year later in May 2012 he published Improving performance on twitter.com on the official Twitter blog explaining the new history technique they were using and how it had dramatically improved the performance of the site.
In fairness to Twitter, I should point out that when they launched their hashbang single page app back in 2010 the HTML5 history API wasn’t widely available—IE didn’t support it at all, and I seem to remember Safari 2.0 had a bug which made their implementation unusable. Thankfully this is no longer the case today.
More recent articles
- I built a ChatGPT plugin to answer questions about data hosted in Datasette - 24th March 2023
- Weeknotes: AI won't slow down, a new newsletter and a huge Datasette refactor - 22nd March 2023
- Don't trust AI to talk accurately about itself: Bard wasn't trained on Gmail - 22nd March 2023
- A conversation about prompt engineering with CBC Day 6 - 18th March 2023
- Could you train a ChatGPT-beating model for $85,000 and run it in a browser? - 17th March 2023
- Stanford Alpaca, and the acceleration of on-device large language model development - 13th March 2023