In the beginning, there was the internetEvery website was a single webpage. They were horrifying geocities nightmares, like this.
Routing was bornRouting 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.
Routing grew upRouting 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
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 bornSo 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.