Skip to main content

What is #/products/toaster - The origin of the URL Hash

This post is historical, and exaggerated to emphasize points. It is not historically accurate, and it's tone is intentionally light, so that the subject matter is easier to absorb.

In the beginning, there was the internet

Every website was a single webpage.  They were horrifying geocities nightmares, like this.


The internet was a treacherous place, and the Back button had one purpose, to escape something you never wanted to see in the first place.  But the .com boom happened, and every company wanted a webpage.  It became immediately apparent that a single page wasn't enough. So...

Routing was born

Routing initially meant that you could link to any folder in the file tree that contained your website.  If you had a Tools folder inside of the folder with your website, then you could reach it on the web by adding /Tools to the URL.


The default page configuration was born.  When you go to a folder, the website would try to open the default page (usually index.html or default.aspx) even if you didn't specify the file name in the URL.  Of course, you could browse to specific files in the file system as well.  Developers used this to manage the location of javascript and css files and the world of geocities was no more.  It was replaced by the world of PHP.  Everyone with a computer could suddenly host a website, and it was...better than it was before.  At least, the Back button had a purpose.  Companies would allow you to browse their websites now, with multiple pages, and you could go back to different parts of the website and look at neat things.  The users got used to this feature and liked using the Back button to go back if they didn't want to be somewhere (like the buy now page).

Routing grew up

Routing was all well and good, but there was this concept of clean code in programming that this file structure based routing ignored.  So we finally got around to implementing a concept that some guy created in like the 70s.  Ruby on Rails showed us how to use MVC (if you're new to web development, Model View Controller is a pattern for organizing code).


Suddenly, routing wasn't just based on your file structure.  Developers had a routing engine they could play with.  They could directly point you to different files, or even different functions via Routing.  They began to generate webpages on the fly, and the web application was born--er, well made better.  Suddenly you found cool pages like amazon.com/products/1234 and websites had thousands of pages because each page was generated as you needed it.  And the internet was a happy place.  Users could now send links to their favorite stuff to their colleagues, directly.  The internet was easier to find your way around!  The routing engine was born--er, enhanced--er, made more clear & explicit.  Whatever, the point is web programmers started using Routing Engines in their code.

Microsoft fixed the internet

Somewhere along the way, it was decided that the internet was ugly, and slow.  People would try to upload a 9000 hour YouTube video and complain that they had to wait while it uploaded.  Waiting?  That's not the way things should work in 1995.  So Microsoft started trying new things.  In 1996 they created frames (god help us) and more important, in 1998 they created a Javascript feature that we now call AJAX.


AJAX created this world where you could click a button and the webpage didn't refresh.  Instead, the data was transmitted behind the scenes, and you were able to keep doing other stuff on the website.  AJAX truly changed the internet.  The internet was starting to look like the applications users ran on their desktops, and people were happy.

But that's not good enough!

Software developers are always trying to make things better.  In the early 21st century some super smart over-eager developers decided it was time to improve the internet.  Sure, you could implement some of your website in AJAX, but why not all of it?  What if your website never had to load a new webpage at all?  Was this a good idea?  WHO CARES!


The Single Page Application was born.  They would implement an entire website in AJAX, and the user would only see one page and click around it.  To the users, the difference was negligible.

Except it was broken

Broken you say?  Nonsense!  Very smart people created this.  It works flawlessly.  People explained that the simple features they'd come to expect from websites did not exist anymore.  When they clicked the Back button, it took them out of the app entirely, instead of going back to the previous section where they were working.  When they sent the link to their friends, it brought their friends to the home page, rather than the specific section where they were working, so it was confusing.  The internet was broken!  The users were confused by these new Single Page Applications.  Developers were forced to fix it.

The URL Hash was born

Well, actually, developers had known about it for years.  In the URL, you can directly navigate around the page using the # hash tag.  In fact, it's been used on FAQs quite a bit to link to the answer that's already on the page so that you don't have to scroll down.  What was neat about this feature, is by including it in the URL, you could send a user directly to that part of the page.  The website was able to read from this tag and do stuff. COOL!


*cough* I mean Hash tag Routing was born

So a bunch of guys got together and decided to take the URL Hash, and build a Routing Engine for it!  And (after some attempts) frameworks like Sammy.js were born.

The URL hash could be used to send users to sections of the Single Page Applications, just like they were used to the rest of the URL sending them to different parts of the Website.  The Back button would take them to the previous hash, so they would be moving around the app like they expected, and not completely dropped out of it.  And they could link their friends to the neat stuff they'd seen.  And the web was happy again.

But the internet didn't end there!

OK, yes the web didn't end at URL Hash Routing Engines.  Some guys improved upon it at Google by making AngularJS and lots of other fancy stuff is continuing to make the web a better (albeit more complex) place.  This is not the end, but just know, that as long as there's capable developers out there, there will always be more stuff being built.  The SPA features have matured, and we've learned to use SPAs sparingly and for some very specific purposes (like posting on this blog).  SPAs also showed that a website should be made up of numerous web applications, instead of being just one, and so the web is still absorbing this new feature and I expect speed bumps to continue.

Comments

Popular posts from this blog

Managing Developers is HARD

I've been a software dev for a long time.  I've also been running my own software company for a few years now.  This is important information because of why I do these things.  I am a sofware developer because I love learning.  I slack off when doing a job that bores me, and software development always has something new to experience which keeps me excited and interested.  Why start a software company then?  That puts me in the role of manager rather than developer.  The truth is simple.  I've worked for a lot of companies, and I don't see any of them doing a great job of managing their software development.  That's not to say none of them have done a good job, but no one out there seems to be doing a great job.

How are they different?
A lot of companies get this part right.  Software developers are different from other employees.  The distinction is important in the same way it's important to acknowledge that an insurance agent is different from a construction…

When Is Software Done?

I have some very exciting news.  A piece of software I've been working on for over 2 years is released to the general public!  This is a little exciting if it were software I'd been working on for some big company.  It's very exciting because it's software I have been working on for my company.  That's right!  My company is ready to start selling software and start making money!

I'm not gonna use this blog post to talk about my company and what it does.  You can read about that in our press release.  Instead, I'm going to talk about the software industry and the concept of done.  Because, as with everything, it's more complicated than it seems.

Software is never really done
Actually that's a misnomer.  Software can really be done.  But done is sort of a quantum state--there and not there at the same time.  First and foremost, anyone can understand that software that works is complete.  If the software's purpose is to process a credit card, if th…

How to identify a skilled programmer during an interview

How does one identify a skilled programmer?  No company that has interviewed me could tell the difference between myself and other programmers they'd interview.  The interview process is truly a game of luck in this industry--on both sides.  Both the programmer and the company are basing their actions entirely on luck.

Companies have come up with numerous methods to attempt to discern a good programmer from a bad one.  The best tricks they have include a series of math problems, algorithms, problem solving technique tests, and even obscure programming questions, some without definitive answers.  As an example: Is there an authoritative source of information on the core principles that define object oriented programming?  I've heard everywhere from 3 to 7.  In a field of research about a synthetic concept, an authoritative answer is almost impossible to obtain.

Programmers were then forced to study to the interview.  Careercup is one of my favorite sites for this.  This almost …