by LEDThereBeLight · 4y ago · 0 comments
Eventually, the original guideline of HTML for structure, CSS for styling, and JavaScript for interactivity started to not really make sense anymore for many websites, because as pages became more interactive, the lines became blurred. If you look at a site like GMail, where does the page structure end and interactivity begin?
With large parts of a page being interactive, it becomes difficult to manage all the state involved, especially if it’s a “live” page that updates in real time and may have several people viewing it.
Frameworks were introduced as a way to manage state and allow websites to re-render efficiently without hard page refreshes.
It's a history of one decision after another, made hastily, often in anger, and it's how we got ... here.
But most sites aren't GMail. Frameworks and typescript should still be the exception, and the rule should still be independent, modular libraries like JQuery.
People always say this but it's so hollow. Most sites aren't Gmail, but we're not building most sites. We're building applications that work in similar fashion to Gmail, thus need similar stuff like all these frameworks provide.
"Oh but everyone's using React to build their blogs instead of writing new posts for them and that's overkill"
Let me stop you before we get to this point. People use their personal blogs as a way to test new concepts they want to learn, so of course it's gonna be over engineered to hell.
I pushed back hard on introducing React when the site already had jQuery. Another developer said they could do what was needed with React.
The marketing site started shipping both jQuery and React.
I hate the JavaScript/React ecosystem so damn much for its complexity.
And JS shouldn't be exceptionally bad but here we are, and people use TypeScript as alternative to stay sane.
I agree that modern web development comes with far too much complexity on average, but people started adopting those frameworks for a reason. The web is kept backwards compatible with obsolete standards which have been created in a different time for different purposes, and at some point it becomes easier to build abstractions over that. For example TailwindCSS adds another "compilation" step and configuration file but in return makes styling much more tolerable than standard CSS. Is it necessary? No, but when you build a large website all those little things add up.
My emphasis added.
There are still absolutely tons of sites for which the classical model works fine, and indeed works better than React at al, because pages load faster and behave more normally.
Some of those sites are now built with React et al anyway, for some bad reason (cargo culting, resumé-driven development, etc). But still, most are not, i suspect. Classical web development is still a very useful skill.
However, i suspect that although a majority of web sites don't involve React et al, a majority of web development jobs do - because the fraction of sites that are complex enough to need React et al also need a lot more developers!
(a fact i think is fun: a majority of stars are in binary or multiple star systems, even though such systems are a minority of star systems)
Ouch! As a google mail theft victim, "right in the heart" :(
> efficiently without hard page refreshes.
And completely destroying the "Back-forward-refresh" functionality.