Live data from Hacker News

Building a robust frontend using progressive enhancement

gov.uk

51–60 of 168 posts

Re: Building a robust frontend using progressive enhancement

#51
post #42

Genuine question: Judging from the comments, seems like people like this approach. So why is the general trend more towards approaches that use javascript (sometimes unnecessarily) and frameworks like React?

Because browsers are being used as application frameworks (i.e. for making applications) rather than what they were designed for.

Re: Building a robust frontend using progressive enhancement

#52

OMG it feels so good to not be the lone voice in the woods. I would say about 3/4 of my frustrations as a user are from sites that should have simply been built with HTML + CSS and minimal Javascript. The front end community most days feels like a jobs program.

You aren't alone, I'm a technical director and even I can't win this battle. We have a ton of complexity on what could be a simple SSR site, but frontend devs don't like writing anything but SPAs, so it's hard to change.

Re: Building a robust frontend using progressive enhancement

#53
post #42

Genuine question: Judging from the comments, seems like people like this approach. So why is the general trend more towards approaches that use javascript (sometimes unnecessarily) and frameworks like React?

As an end user, I really like the style of applications that GOV.UK write and endorses - lightweight, clean layouts, accessible, and generally work with minimal (or no) JavaScript. And I dislike most SPAs, because they usually end up breaking lots of expected browser functionally, are useless without JavaScript, and often load all kinds of heavy dependencies from various third party sites.

But what users like and what developers like (and can quickly develop) are often very different things.

Re: Building a robust frontend using progressive enhancement

#54
post #42

Genuine question: Judging from the comments, seems like people like this approach. So why is the general trend more towards approaches that use javascript (sometimes unnecessarily) and frameworks like React?

Nobody got fired for building an app in React? When something is an accepted as an industry standard, it's safe to make a decision that goes with the flow. Also, nobody is doing devrel for html/css/vanilla js - if you search how to do things you will find nearly only exclusively framework related content.

Re: Building a robust frontend using progressive enhancement

#55
post #42

Genuine question: Judging from the comments, seems like people like this approach. So why is the general trend more towards approaches that use javascript (sometimes unnecessarily) and frameworks like React?

Because the trend is also towards doing more over the web.

The web is replacing traditional thick clients, which also assumed a fairly stable network connection and platform specification.

Government systems need to work with the lowest denominator - even if it's not that common. Tech startups only need 1 client to exist at the start (and can mostly trust that their requirements will become commonplace as they scale).

Re: Building a robust frontend using progressive enhancement

#56
post #42

Genuine question: Judging from the comments, seems like people like this approach. So why is the general trend more towards approaches that use javascript (sometimes unnecessarily) and frameworks like React?

Because the ux and dx are better once you reach a certain amount of complexity. Companies know what is best for their business.

There were will always be a group of devs that don’t like it because it isn’t the same web as in their heyday, and they all will eagerly pile on anything remotely JS-critical is posted on HN.

There is a selection bias to the comments that does not accurately reflect the industry opinion.

Re: Building a robust frontend using progressive enhancement

#57
post #42

Genuine question: Judging from the comments, seems like people like this approach. So why is the general trend more towards approaches that use javascript (sometimes unnecessarily) and frameworks like React?

Firstly it's what looks good in demos, both internally to management and when trying to sell things to consumers. Government services have users without a choice and usually that they have to provide it has been decided top down.

Secondly it's less "boring" for developers and arguably less work.

Thirdly you have a large amount of only-frontend (often only-React) devs know who won't think of alternatives.

Re: Building a robust frontend using progressive enhancement

#58
For medium to large projects, SPA or not basically boils down to the question where you want to manage the state and logic, is it at frontend(SPA) or backend(MVC,CRUD,etc), you still have to do that somewhere with complexity.

If the website is simple then definitely no SPA is needed, either htmx or alpinejs or vanilla can get the job done.

Re: Building a robust frontend using progressive enhancement

#59
post #8

User first programming rather than work inflating bloated frameworks mainly used to justify further dev work. Which one do engineers choose

I think SWE must be the only (allegedly) engineering discipline where developer convenience is overtly prioritised above product quality or user experience.

If you doubt this, think how many times you've seen a framework advertised due to its ease of use for developers vs due to e.g. performance in low bandwidth.

Re: Building a robust frontend using progressive enhancement

#60

OMG it feels so good to not be the lone voice in the woods. I would say about 3/4 of my frustrations as a user are from sites that should have simply been built with HTML + CSS and minimal Javascript. The front end community most days feels like a jobs program.

It seems that the pendulum of public opinion is swinging back towards simple, mostly HTML-based solutions, with the rise of intermediate solutions like htmx.
Post reply on HN