Why we use progressive enhancement to build Gov.uk
gdstechnology.blog.gov.uk
gdstechnology.blog.gov.uk
Or for being paid, progressive enhancement is more work than not doing it and if the client/manager/… doesn't want to pay for it… the dev is unlikely to bother doing it on their own dime.
A rephrasing might ask why we make technology choices that exclude 20% users?
If we're not able to produce a single page web app that reaches 100% of users, that's cool... just make a many page web site without lots of JavaScript that does.
PE is not what the client pays you for.
> You have to go out of your way to screw it up.
Hardly. The shortest path to the whizzbang the client wants will break PE all on its own.
Come to think of it, given how most websites are designed, I'm starting to think we're making a mistake with sticking to HTML/CSS/JS. We should move to "executable Photoshop image" format - so that the beautiful magazine-like layouts made by designers could be implemented without a shit ton of hackery and bloat webdevs have to put nowadays. We could also push some security and sanity decisions into the format this way, so that the tool itself would tell the designers they can't (or shouldn't) do something.
(I'm only slightly sarcastic here.)
Call them boss, call them stakeholder, call them prospects, call them whatever you want, point is, progressive enhancement requires actual hard work, it's not the default state of things when you move beyond the "research paper" format of having a bunch of paragraphs of text interspersed with section titles on a completely static page.
I used to throw them together in Frontpage or Dreamweaver with a few optional scripts. Scripts for things like page counters or menus I just cut and pasted off dynamicdrive.com followed by tests in several browsers. Backend handled forms and such. Worked on every browser, loaded up fast on dialup, and everyone knew what my HTML/CSS code did without training. Can't say that about most of these sites and frameworks these days. So, I'd say it's easiest and a sensible default.
To be clear, I'm not critiquing complex, web applications that truly need advanced tooling client-side. I'm talking about 90+% of what's out there that just publishes content with minimal dynamic elements needed.
We owe it to our users to provide all of them with a good experience. We also owe it to ourselves to write good, clean, maintainable applications. The wonder of it is that very, very often if we write RESTful apps then progressive enhancement just falls out naturally: a GET request with some JSON Accept header will return data; with text/html it'll return data, and possibly a form to update it; a POST with some JSON Content-Type will DTRT, and so will one with application/x-www-form-urlencoded or multipart/form-data.
Why wouldn't one do that?
Of course, the user experience of such an app isn't as great as a singing, dancing single-page app (SPA). But a user experience is better than no user experience, which is what offering only an SPA provides.
It's just sloppy to require JavaScript and CSS to use a web site. It's particularly sloppy when that web site is composed of documents.
Where do you draw the line?
Do I have to also support people who prefer to use command line text-based web browsers?
Before you know it we'll have someone say "Oh I work for a bank, we have HTML disabled here. Can you make it work without HTML?" give me a break.
Yes. The web is about linked HTML documents: if you don't support lynx, links, elinks, w3m, emacs-w3m & eww then you're honestly not doing Web development properly.
You have to do more work to not support them, because writing plain HTML + forms is the baseline.
> Before you know it we'll have someone say "Oh I work for a bank, we have HTML disabled here. Can you make it work without HTML?" give me a break.
That wouldn't be using the Web anymore.
As for those who really are building web applications - well, those are separate beasts. Nobody expects to run Google Docs or Gliffy properly in lynx. But I do expect my banking site to run in a text browser, because there's no valid reason it shouldn't.
(Yes, I understand the business reasons for the current sad state of the web. I also believe those reasons are things one should be ashamed of.)
Support everyone with a browser & internet access, optimize for the stuff that has the greatest market share or where you can do the most good and stand a good chance of having your dependencies met.
There's a litany of reasons, but they all basically boil down to it's more work than just picking one solution that you think most people will use and executing on it well. Those users usually get a better experience and the pointy-haired boss is happy you shipped so fast. I didn't have the luxury of doing any of this until working at my current Big Co. web job, where accessibility is non-negotiable and we actually take steps to make sure everyone can use our sites. But even then don't serve pages that work without javascript half the time.
* user’s hotel is intercepting the connection and injecting broken JavaScript
* user’s telecoms provider is intercepting the connection and injecting broken JavaScript
* user’s country is intercepting the connection and injecting broken JavaScript
Broken or not: all three of those sound like good reasons to intentionally block JS.
Who the hell puts up with stuff like this? Is this real?
If so, time to switch provider. Really.
Having someone intercept my signal and process it behind my back is simply not something I would tolerate from any communications-service provider I employ.
Some also block JS (sometimes accidentally). Remember Sky? https://www.theguardian.com/technology/2014/jan/28/sky-broad...
They did honour the 'Cache-Control: no-transform' header though, so every site I build now includes that directive.
Edit to clarify: The user turning off JS and using the service are likely to happen at entirely different times. If you browse with JS turned off, it's likely off by default and only enabled when needed (if at all).
So no, it’d be more expensive to have a call centre.
You're also assuming that starting from a simple HTML implementation is more expensive than other methods. I'm not sure that's the case.
As a rule, in terms of accessing public services at least, I'd be inclined to be very careful to make sure it was as accessible as possible.
SSL is supposed to work a certain way, in practice it doesn't always work that way.
Hahahahahaha, you should do stand-up!
In my more cynical moments, I wonder if the whole point of SSL is to obscure when middleman proxies are in use.
Seriously, examine your browser's trusted CA list. Do you really trust every single one of those CAs to vouch for any website in the world?
That's because unlike "modern" sites, it contains the site's contents in the HTML, so when the HTML is loaded, you have everything you came for.
% curl https://gdstechnology.blog.gov.uk/2016/09/19/why-we-use-progressive-enhancement-to-build-gov-uk/ >test.html
% du -h test.html
36K
That amount of data can still be downloaded over the slowest mobile link imaginable in a fraction of a second. And whatever scripts are needed to do whatever extra can be downloaded and happen after the fact. That's how the web used to work.Compare to "modern" SPA-monstrocities (like blogger.com until recently), where you had actual code written to defer showing the (1KB) content (which you came for), until several MBs of fonts, scripts and whatever had loaded, parsed and executed.
It was enough to make page-loading on a high-speed connection of a modern PC take many many seconds. On a mobile phone with a weak CPU this can lock your phone up for quite a time.
If that's not an anti-pattern I don't know what is.
We need to get back to the basics. The basics worked, and the direction we're heading is doing all the wrong things.
Whoever came up with that idea should be loaded, parsed and executed.
> We need to get back to the basics. The basics worked, and the direction we're heading is doing all the wrong things.
Frankly, it's gotten to the point that I don't even like using my smartphone anymore. Even with uBlock, sites take too long to load, they do annoying things with animations, colors and behaviour, and it's just generally a burden to use.
I just want to be able to read documents and follow links to other documents. The Web was awesome when it was a web of documents, linked together.
YOU THERE! YOU, SILLY USER!! YOU'RE SCROLLING WRONG. LET ME HANDLE SCROLLING FOR YOU!!
That's a bit of an excessive enthusiasm. EDGE is effectively ~200kbps (30kB/s) with ~200ms ping, so you're at a good 1.5s assuming no dropped packets.
And that's not "the slowest mobile link imaginable" by a long shot, GPRS is under 100kbps and before that was CSD (around 14kbps, with high speed CSD around 56k)
And CSD was already 2G, 1G was NMT, at 1200 bits per second.
None of these even require imagination, they're existing historical mobile links, most of which (GPRS up) are still in active use (I believe NMT has no deployment left, and while I'm reasonably certain most telecoms have dropped CSD I wouldn't bet that all deployments are gone)
However what is happening there basically taking work away from big outsourcing contracts(Lots of easy money involved) with companies like Capgmini. Upsetting the people in those companies, and civil servants who want to eventually work with those companies. These companies generally hires ex-civil servants they used to work with.
They're also taking away responsibility from the individual departments also upsetting empire building civil servants, even if GDS is doing a better job. At the moment there's talk of breaking up gds and giving services back to the departments who did a terrible job in the first place.
So you get a lot of drama and arguments involved, and "House of Cards" style schemes against them to try to get rid of them. Frankly with all the money and self interest against them, i've surprised they've lasted this long.
It's rare for me to say David Cameron and his friends did anything right, but this was one initiative that did make the world a better place. GDS wouldn't have been around this long without significant support from the very top. It is telling that a change of political fortunes will likely coincide with GDS losing primacy.
I mean don't get me wrong, it's fine as far as it goes. It does look nice. But it doesn't make the actual functionality noticeably more usable, so it's hard to see what all the fuss is about.
They added Google Analytics everywhere. Even on the pages where you fill in your taxes or apply for a passport. Google does not need to know my tax details. Google shouldn't know my tax details. Since Google isn't even a UK company the UK government doesn't even have legal authority over what Google does with the information they now hold about UK citizens taxes.
Where on that site does it use Google Analytics?
They tell you they're using the cookies. They tell you why they use them. They tell you how to opt out of them.
They also say:
>> We don’t allow Google to use or share our analytics data.
Browsing privacy is not just about the intentions of the two parties talking to each other but everyone one holding the wire plus everyone the other sites invites to listen in on your private exchange.
No you don't. You don't "send" anything over to Google. The users browser does because loading a gov.uk page also loads a Google Analytic script straight from google-analytics.com. You don't have the power to prevent the users IP being sent to Google in that situation and it's worrying that you think you do.
Additionally, focusing on the IP address seems rather silly when a much more accurate tracking cookie is being used.
If it is at all a representation of how smoothly the overall government runs, then "shut up and take my taxes."
Today I had to try three times to get 1password to satisfy the insane requirements of the site (8-12 alphanumerics, no special characters).
GDS isn't enforcing weird password policies across government.
This is the advice GDS publishes on passwords: https://www.gov.uk/service-manual/user-centred-design/resour...
In think it makes perfect sense that apps like Slack, New Relic, etc. are SPAs. But in news/blog type sites for example, it often leads to worse user experience in my opinion. A lot of traffic (and for some sites probably the majority) is external, directly pointing to an article.
In that case, I rather have a full page reload when i happen to click on a related article after reading than watching a spinner for second(s) every time I land on their page somehow.
If so: then does it make sense to download megabytes of JS libraries in order to save downloading 100kB of text?
To put it in concrete terms, I came to the conclusion that SPAs (or at least using javascript to implement most behaviors on individual pages of a multi-page application) make a ton of sense after spending a few years building an internal line-of-business application with a lot of behavior and not much content as a normal Rails multi-page app, noticing that the user experience was not great at all, and finding it to have very low return on investment to attempt to do it with progressive enhancement. We would have saved a lot of time and money by starting with a JS-based SPA approach for an application like that. If I were building a blog or news site, I suspect the opposite would be true.
That's why I comment in a new tab.
But yes, I see that as an example where JavaScript could improve an HTML page — but that's no reason to make it impossible to use with JavaScript!
That being said, you do have to be careful or your site may break for people utilising accessibility technologies such as a screen reader.
They might know know or care what the technical reasons or solutions are. That's supposed to be our job.
And so getting rid of JavaScript as a tool to make things work just doesn't make sense.
Hopefully flexbox becomes more prolific.
Don't do that then. Seriously, browsers aren't meant to provide bit-for-bit precision. Really, they can't: your page will be viewed on phones, on phablets, on tablets, on laptops, on desktops, on giant wall-screens; it will be viewed in colour, in black-and-white, in high-contrast palettes; it will be viewed with the same fonts you have installed, and without them and in monospace; it will be read aloud; it will be copy-pasted; it will be saved as plain text or as HTML.
Just … don't do that. Resist the impulse to do everything one browser or two browsers will let you get away with; limit yourself to what works on all browsers.
It is a pita, a few weeks ago I implemented a responsive design for a wine website created from the company's print agency, who just vomitted layers upon layers of images on the thing. Zero whitespace. Still it is nothing like it was 10 years ago. IE6 with its float bug simply destroyed the whole layout. Now it is more like "this button is 2px off in Firefox" or "here is some whitespace in chrome".
This one bites me every day. Websites with their social button / analytics scripts before the main feature JS become unusable if the 3rd party JS errors or fails to load.
It's certainly possible to write a site intending to progressively enhance it. It's easy, even.
It's not possible for end users to rely on it existing, because as you note lazy, sloppy developers don't bother.
I prefer to light a candle and curse the darkness.
think of all the savings for the government - no need to update old hardware sitting in the schools, libraries, Councils etc...
Looks like this was removed after a few years: https://github.com/alphagov/frontend/pull/944
I'd like to see the data over that period and see what the JS stats are like today.
[1] https://gdstechnology.blog.gov.uk/wp-content/uploads/sites/3...
I hoped this would be a quick and pleasant interaction, but - and I really should have guessed it - the Twitter 'operator' was clearly so far removed from the developer that can quickly fix it.
> and recruiting!
When I looked previously it seemed the department was hiring only for short-term contracts?Which worries me a bit if that's the case - I think it's fantastic what and how they're doing it, but not if the philosophy is "ship it and forget".
Re short term contracts, we hire for two year contracts but it’s not explained well that it’s trivial to extend those. We’re also trying to make roles permanent as well in general.
Awesome to see a reply here - I wondered but wasn't hopeful.
It appeared in the beta feedback bar across the top, after completing a rebate (requiring adding a new address, if relevant to the flow) - it then said something like "processing request, will be transferred to your bank in 2-3 days" and had the top orange bar "this personal tax site is in beta, give us your feedback here" or similar.
Clicking the feedback link from that page redirected to `localhost:<port>/correct/uri/to/feedback`. After exploring the site some more, I tried the feedback link again (different page) and it worked fine.
If memory serves, the port was `3157` - I'm not totally sure, but it may help your search.
Just to be clear - the feedback I wanted to leave was wholly positive!
Cheers :)
> millions of GBP per line of CSS
This is a silly metric, because quite a lot of the effort is spent in reducing the amount of CSS. And that's how other projects get screwed up: silly metrics.
The government is also under a statutory obligation to be accessible.
There are some good tech people working in UK Government, there are also some utterly terrible ones. I'd far rather have GDS spending the odd million to provide a baseline of what we should expect from Government IT than put up the culture that has foisted every other Government IT disaster on us.
There's the post office stuff, where errors made it look like sub-postmasters were stealing stuff. Several of those people died by suicide; others went to jail, before the company accepted their software was wrong. http://www.bbc.co.uk/news/uk-23233573
http://www.bbc.co.uk/news/uk-32377013
There was the software for the probation service which was abandoned after the budget tripled:http://news.bbc.co.uk/1/hi/uk_politics/8339084.stm
And there's the health stuff, which cost billions.
You're getting downvoted because everyone already knows governments waste taxpayers' money—thus your comment is redundant.