Frameworking

There are many reasons to use a JavaScript framework like Vue, Angular, or React. Last year, Nicole asked for some of those reasons. Her question received many, many answers from people pointing out the benefits of using a framework. Interesingly, though, not a single one of those benefits was for end users.

(Mind you, if the framework is being used on the server to pre-render pages, then it’s a moot point—in that situation, it makes no difference to the end user whether you use a framework or not.)

Hidde recently tried using a client-side JavaScript framework for the first time and documented the process:

In the last few months I built my very first framework-based front-end, in Vue.js. I complemented it with a router, a store and a GraphQL library, in order to have, respectively, multiple (virtual) pages, globally shared data and a smart way to load new data in my templates.

It’s a very even-handed write-up. I highly recommend reading it. He describes the pros and cons of using a framework and using vanilla JavaScript:

I am glad I tried a framework and found its features were extremely helpful in creating a consistent interface for my users. My hope is though, that I won’t forget about vanilla. It’s perfectly valid to build a website with no or few dependencies.

Speaking of vanilla JavaScript… the blogging machine that is Chris Ferdinandi also wrote a comparison post recently, asking Why do people choose frameworks over vanilla JS? Again, it’s very even-handed and well worth a read. He readily concedes that if you’re working at scale, a framework is almost certainly a good idea:

If you’re building a large scale application (literally Facebook, Twitter, QuickBooks scale), the performance wins of a framework make the overhead worth it.

Alas, I’ve seen many, many framework-driven sites that are most definitely not that operating at that scale. Trys speaks the honest truth here:

We kid ourselves into thinking we’re building groundbreakingly complex systems that require bleeding-edge tools, but in reality, much of what we build is a way to render two things: a list, and a single item. Here are some users, here is a user. Here are your contacts, here are your messages with that contact. There ain’t much more to it than that.

Just the other day, I saw a new site launch that was mostly a marketing site—the home page weighed over five megabytes, two megabytes of which were taken up with JavaScript, and the whole thing required JavaScript to render text to the screen (I’m not going to link to it because I don’t want to engage in any kind of public shaming and finger-wagging).

I worry that all the perfectly valid (developer experience) reasons for using a framwork are outweighing the more important (user experience) reasons for avoiding shipping your dependencies to end users. Like Alex says:

If your conception of “DX” doesn’t include it, or isn’t subservient to the user experience, rethink.

And yes, I am going to take this opportunity to link once again to Alex’s article The “Developer Experience” Bait-and-Switch. Please read it if you haven’t already. Please re-read it if you have.

Anyway, my main reason for writing this is to point you to thoughtful posts like Hidde’s and Chris’s. I think it’s great to see people thoughtfully weighing up the pros and cons of choosing any particular technology—I’m a bit obsessed with the topic of evaluating technology.

If you’re weighing up the pros and cons of using, say, a particular JavaScript library or framework, that’s wonderful. My worry is that there are people working in front-end development who aren’t putting that level of thought into their technology choices, but are instead using a particular framework because it’s what they’re used to.

To quote Grace Hopper:

The most dangerous phrase in the language is, ‘We’ve always done it this way.’

Have you published a response to this? :

Responses

Hidde

Great post! And thanks so much for the shout out

# Posted by Hidde on Thursday, May 9th, 2019 at 6:43am

Jacques Pyrat

Les raisons qui font choisir un framework ne prennent pas en compte les utilisateurs finaux… Triste. Et pourtant, j’ai choisi SPIP pour ce qu’il apporte aux rédacteurs et aux lecteurs. adactio.com/journal/15111

6 Shares

# Shared by Lawrence Meckan on Friday, May 3rd, 2019 at 9:49am

# Shared by Adewale Oshineye on Friday, May 3rd, 2019 at 9:57am

# Shared by Jed Dela Cruz on Friday, May 3rd, 2019 at 12:10pm

# Shared by Milan on Friday, May 3rd, 2019 at 12:55pm

# Shared by @kethinov@mastodon.social on Friday, May 3rd, 2019 at 3:32pm

# Shared by Lars Laade on Sunday, May 5th, 2019 at 8:00pm

20 Likes

# Liked by Gunnar Bittersmann on Thursday, May 2nd, 2019 at 4:19pm

# Liked by DerJansinn 🐵 on Friday, May 3rd, 2019 at 10:03am

# Liked by theAdhocracy on Friday, May 3rd, 2019 at 10:03am

# Liked by Dan Danowski on Friday, May 3rd, 2019 at 10:03am

# Liked by Sara Brunettini on Friday, May 3rd, 2019 at 10:32am

# Liked by Richard Sanderson on Friday, May 3rd, 2019 at 10:32am

# Liked by Rhian van Esch on Friday, May 3rd, 2019 at 10:32am

# Liked by Elias Günther on Friday, May 3rd, 2019 at 10:58am

# Liked by Petr Soukup on Friday, May 3rd, 2019 at 10:58am

# Liked by Jörg Schmidtmann on Friday, May 3rd, 2019 at 11:30am

# Liked by James Shvarts on Friday, May 3rd, 2019 at 11:30am

# Liked by Joseph Fitzsimmons on Friday, May 3rd, 2019 at 12:02pm

# Liked by Christof on Friday, May 3rd, 2019 at 12:02pm

# Liked by Philip Renich on Friday, May 3rd, 2019 at 12:33pm

# Liked by Rasmus Kaj on Friday, May 3rd, 2019 at 1:59pm

# Liked by Batbayar B. on Friday, May 3rd, 2019 at 1:59pm

# Liked by @kethinov@mastodon.social on Friday, May 3rd, 2019 at 3:58pm

# Liked by Max Nikitin on Saturday, May 4th, 2019 at 5:49pm

# Liked by Lars Laade on Sunday, May 5th, 2019 at 8:27pm

# Liked by John Dunlevy on Thursday, May 9th, 2019 at 5:07pm

Related posts

Switching costs

The enshittification of React …which was already pretty shitty for users.

Lightweight

Minimum viable television and minimum viable websites.

Frustration

Applying the principle of least power to tools and technologies.

Less JavaScript

The Google developer relations team are dishing out some inconvenient truths.

Mind the gap

If you’re making a library or framework, treat it like a polyfill.

Related links

Web Components Will Outlive Your JavaScript Framework | jakelazaroff.com

Decision time:

There’s a cost to using dependencies. New versions are released, APIs change, and it takes time and effort to make sure your own code remains compatible with them. And the cost accumulates over time.

This post is about more than web components:

If we want our work to be accessible in five or ten or even 20 years, we need to use the web with no layers in between. For all its warts, the web has become the most resilient, portable, future-proof computing platform we’ve ever created — at least, if we build with that in mind.

Tagged with

Using Stencil to make a live poll Web Component

Before getting into the details of the code, Matt hits the nail on the head talking about the the one thing that web components have that no framework can offer: longevity.

Quoting Stuart Brand:

Old systems break in familiar ways. New systems break in unexpected ways.

Well! The web is an old system.

Tagged with

Building a Frontend Framework; Reactivity and Composability With Zero Dependencies

The thinking behind the minimal JavaScript framework, Strawberry:

Even without specialized syntax, you can do a lot of what the usual frontend framework does—with similar conciseness—just by using Proxy and WebComponents.

Tagged with

Tech-last

I’ve spent a lot of time thinking, talking and writing about evaluating technology and what Robin describes here is definitely a bad “code smell” that should ring alarm bells:

What’s really concerning is when everyone is consumed with the technology-first and the problem-last.

Unless you’re working in an R’n’D lab, start with user needs.

I’m certain now that if you want to build something great you have to see through the tech. And that’s really hard to do when this cool new thing is all that anyone is talking about. But that’s why this one specific thing is the hallmark of a great organization; they aren’t distracted by short-lived trends and instead focus on the problem-first. Relentlessly, through the noise.

Tagged with

When JavaScript Fails

So, if progressive enhancement is no more expensive to create, future-proof, provides us with technical credit, and ensures that our users always receive the best possible experience under any conditions, why has it fallen by the wayside?

Because before, when you clicked on a link, the browser would go white for a moment.

JavaScript frameworks broke the browser to avoid that momentary loss of control. They then had to recreate everything that the browser had provided for free: routing, history, the back button, accessibility features, the ability for search engines to read the page, et cetera iterum ad infinitum.

Tagged with

Previously on this day

6 years ago I wrote Thanos

Avengers are wizards; Thanos is a prophet.

6 years ago I wrote Service worker resources

Hyperlinks to help you get your site working offline.

7 years ago I wrote Styling the Patterns Day site

A few days in Gridlandia.

9 years ago I wrote 100 words 041

Day forty one.

11 years ago I wrote dConstruct 2013

Put the date in your calendar.

12 years ago I wrote Questions for Mobilism

I’m going to be moderating two panel discussions. What should I ask the panelists?

13 years ago I wrote Jared Spool: The Secret Lives of Links

Liveblogging Jared’s talk at An Event Apart in Boston.

13 years ago I wrote Ethan Marcotte: The Responsive Designer’s Workflow

Liveblogging Ethan’s talk at An Event Apart in Boston.

13 years ago I wrote Luke Wroblewski: Mobile Web Design Moves

Liveblogging Luke’s talk at An Event Apart in Boston.

13 years ago I wrote Veerle Pieters: The Experimental Zone

Liveblogging Veerle’s talk at An Event Apart in Boston.

13 years ago I wrote Whitney Hess: Design Principles — The Philosophy of UX

Liveblogging Whitney’s presentation at An Event Apart in Boston.

13 years ago I wrote Jeffrey Zeldman: What Every Web Designer Should Know — A Better You At What You Do

Liveblogging Jeffrey’s opening talk at An Event Apart in Boston.

14 years ago I wrote Understanding

Read what Ben Ward has written.

19 years ago I wrote Weekend in Seattle

Seattle is my kind of town. Whenever I’m here visiting, I always find myself thinking about what it would be like to live here. I think I could get used to the lifestyle.

20 years ago I wrote Now with even fewer wires

Brighton has some new wireless hotspots thanks to the good folks at Loose Connection.

21 years ago I wrote Leopold Kraus

Jessica came across the website of a surf-rock band that I used to play with when we were both still living in Freiburg, Germany.

22 years ago I wrote No Macs need apply

Jessica and I have thinking about getting some of our stuff insured (the computers, musical intruments, etc.). Jessica spent some time today comparing insurance policies online.