8 Aug, 2016
Back in the day the web used to be very simple. Your browser sent a GET request to a URL, the server returned an HTML page and the browser displayed it.
Since then, user experiences can be improved using AJAX so that partial page updates are possible, and with JS and CSS3 to make certain things animated, but the basics are still the same until relatively recently.
Today, one of the most fundamental parts of the web is disappearing - the URL.
Back in 2009 I repeated the advice in my book that URLs are an element of navigation and that cool URLs don't change.
Well, in 2016 I don't think that advice applies any longer. If you look at the Safari browser on recent Mac OS X browsers, the only thing that is shown is the domain name! There is no path at all, so no point in having a neat URL structure for your users - they won't see it unless they click.
If the site has an expensive security certificate, even the domain isn't shown, and instead the name on the certificate is shown:
If URLs aren't so important today then what does that tell you about the importance of the web's architecture?
It tells me that:
I think the old model of browsing URLs with GET requests in a browser still works really well for consuming data. But I no longer believe it is the best way of inputting it. The reason is that we now have a huge array of devices for inputting data on. Each device has native UI components specifically tailored to its different affordances - for example if you want to enter a date, a pocket smartphone begs to be swiped, whereas for a mouse and keyboard you'd want to use clicks or typing. Expecting to be able to give a single great inputting experience with every type of hardware (or voice even!) is asking a lot.
Let's take a look at the main way of inputting data on the web - HTML forms.
It is fair to say I've never really been 100% happy with HTML forms. I think there are three main reasons:
I think these are three of the reasons why apps have been overtaking the web in lots of areas in recent years. Of course you can fix all three of the above using web technologies alone (Service Worker, Web Components etc), but doing so requires large teams and modern browsers.
Although I think the web as it used to be is becoming less relevant as a consumer-facing thing, it isn't going to lose its importance because in most cases the it is still there behind the scenes - powering everything - you just don't see it as much any more because you don't tend to access it via a browser unless you are retrieving content. In effect, the web is disappearing, even though there are more and more devices on it all the time.
React has changed the way people build applications - both on the web where it started and on native platforms including Mac OS X, Ubuntu, Android and iOS.
I've implemented lots of different architectures with React myself and watched as the community moved first to Flux and then to Redux.
All that time, I've insisted for my own applications, that the original principles of the web aren't broken in my code:
I've also insisted that every URL that the app can generate can be used to load the app back into that state.
In fact I've gone even further and ensured that any URL can also be viewed and navigated from a legacy browser by means of server-side generation of those pages into HTML, that pages get re-hydrated from JSON sent with them and that animations don't break.
Of course, this style of isomorphic or universal app is considered a sort of holy grail in web development and I was initially pleased to have achieved it.
But then when would I actually use it? Well, needless to say that all this work to protect the URL is a lot of work. Given that the the web is disappearing and even when it is not, the URL is disappearing, it seems pretty clear to me that I should just not have bothered making my apps behave like the web.
The reality is that there is normally a clear architecture divide between things that still need to be web-like (e.g. your main marketing website, help pages etc) and things that can be app-like (i.e. everything you see after you have signed in).
This leads to a clear conclusion for me that I think would work for lots of use cases:
The only thing I'd say is that building microservices can be costly, and requires a very solid test-driven-development basis, so I'm usually happy to build a monolith out of something like Django first, but bearing in mind the constraints.
The truth of it is that whatever you build will be judged by how well it suits your users, and how much revenue you generate as a result, not by how perfect its implementation is. The work of the product team is at least as important as appropriate architecture and engineering anyway.
Copyright James Gardner 1996-2020 All Rights Reserved. Admin.