Why I hate Hashbang

Since Twitter switched to their new style interface I’ve been pondering the ramifications hashbangs have to the web.

Hashbang is a way to hide the real content identifier from the URL. For example Twitter uses it like this:

http://twitter.com/#!/derega

In HTTP spec this says the content is twitter.com index page and something called !/derega in that page. This doesn’t mean anything.

Today I was browsing around and ended up on Dan’s page <http://danwebb.net/2011/5/28/it-is-about-the-hashbangs> and then read Ben’s <http://www.adequatelygood.com/2011/2/Thoughts-on-the-Hashbang> good writing.

They both have good points about the Hashbang. Ben says that when used in an application there is good reasoning why Hashbang can be used. But I’d say similarly to Dan that Hashbang should not be used even it is convenient and it works for applications.

Some said that GMail is good example of an web based application which can get away with Hashbangs as nobody wants to link, or bookmark, to one specific email or view of the application. I disagree. Many times I’ve been frustrated with GMail for this specific reason. I would like to keep the state of the view, copy the URL to another browser (or computer) and continue my work. But I can’t as it loses the state. And I’ve been toying with the idea of referring to my emails as URLs in GMail. Why not?

REST

In the end HTTP is pretty good protocol for transferring and referring to content in global manner. Why web applications can’t use this same technology to build their API on top of the same interface I use with my preferred browser.

Let’s take Twitter as an example. They still support the old style URLs:

http://twitter.com/derega

This URL clearly says that it is my Twitter feed. Now, when I access it with a browser the response defaults to HTML page. But then I have another client which sends Accept header with type application/json and instead of HTML page it now returns the feed as JSON object.

I just don’t see any reason why the web and the applications can’t be built like this.