Suspicion

I’ve already had some thoughtful responses to yesterday’s post about trust. I wrapped up my thoughts with a request:

I would love it if someone could explain why they avoid native browser features but use third-party code.

Chris obliged:

I can’t speak for the industry, but I have a guess. Third-party code (like the referenced Bootstrap and React) have a history of smoothing over significant cross-browser issues and providing better-than-browser ergonomic APIs. jQuery was created to smooth over cross-browser JavaScript problems. That’s trust.

Very true! jQuery is the canonical example of a library smoothing over the bumpy landscape of browser compatibilities. But jQuery is also the canonical example of a library we no longer need because the browsers have caught up …and those browsers support standards directly influenced by jQuery. That’s a library success story!

Charles Harries takes on my question in his post Libraries over browser features:

I think this perspective of trust has been hammered into developers over the past maybe like 5 years of JavaScript development based almost exclusively on inequality of browser feature support. Things are looking good in 2022; but as recently as 2019, 4 of the 5 top web developer needs had to do with browser compatibility.

Browser compatibility is one of the underlying promises that libraries—especially the big ones that Jeremy references, like React and Bootstrap—make to developers.

So again, it’s browser incompatibilities that made libraries attractive.

Jim Nielsen responds with the same message in his post Trusting Browsers:

We distrust the browser because we’ve been trained to. Years of fighting browser deficiencies where libraries filled the gaps. Browser enemy; library friend.

For example: jQuery did wonders to normalize working across browsers. Write code once, run it in any browser — confidently.

Three for three. My question has been answered: people gravitated towards libraries because browsers had inconsistent implementations.

I’m deliberately using the past tense there. I think Jim is onto something when he says that we’ve been trained not to trust browsers to have parity when it comes to supporting standards. But that has changed.

Charles again:

This approach isn’t a sustainable practice, and I’m trying to do as little of it as I can. Jeremy is right to be suspicious of third-party code. Cross-browser compatibility has gotten a lot better, and campaigns like Interop 2022 are doing a lot to reduce the burden. It’s getting better, but the exasperated I-just-want-it-to-work mindset is tough to uninstall.

I agree. Inertia is a powerful force. No matter how good cross-browser compatibility gets, it’s going to take a long time for developers to shed their suspicion.

Jim is glass-half-full kind of guy:

I’m optimistic that trust in browser-native features and APIs is being restored.

He also points to a very sensible mindset when it comes to third-party libraries and frameworks:

In this sense, third-party code and abstractions can be wonderful polyfills for the web platform. The idea being that the default posture should be: leverage as much of the web platform as possible, then where there are gaps to creating great user experiences, fill them in with exploratory library or framework features (features which, conceivably, could one day become native in browsers).

Yes! A kind of progressive enhancement approach to using third-party code makes a lot of sense. I’ve always maintained that you should treat libraries and frameworks like cattle, not pets. Don’t get too attached. If the library is solving a genuine need, it will be replaced by stable web standards in browsers (again, see jQuery).

I think that third-party libraries and frameworks work best as polyfills. But the whole point of polyfills is that you only use them when the browsers don’t supply features natively (and you also go back and remove the polyfill later when browsers do support the feature). But that’s not how people are using libraries and frameworks today. Developers are reaching for them by default instead of treating them as a last resort.

I like Jim’s proposed design princple:

Where available, default to browser-native features over third party code, abstractions, or idioms.

(P.S. It’s kind of lovely to see this kind of thoughtful blog-to-blog conversation happening. Right at a time when Twitter is about to go down the tubes, this is a demonstration of an actual public square with more nuanced discussion. Make your own website and join the conversation!)

Responses

Matthias Ott

“Right at a time when Twitter is about to go down the tubes, this [blog-to-blog conversation] is a demonstration of an actual public square with more nuanced discussion. Make your own website and join the conversation!” —@adactio 👏 adactio.com/journal/19029

Maciej J

“but jQuery is also the canonical example of a library we no longer” Don’t we really? Let’s just take AJAX. I mean you could use Fetch, but IE is still around. Also $.post() is simpler then Fetch. And other AJAX libraries better integrate with other libs like Vue, React, Angular.

# Posted by Maciej J on Wednesday, May 4th, 2022 at 3:16pm

Maciej J

Also note that some people still use XP. Yes. Not a typo unfortunately😉. So that is Firefox 52 at best or Chrome 49. Lots of features might be missing even if not using IE…

# Posted by Maciej J on Wednesday, May 4th, 2022 at 3:31pm

Thain

“I’ve always maintained that you should treat libraries and frameworks like cattle, not pets. Don’t get too attached. If the library is solving a genuine need, it will be replaced by stable web standards in browsers.” Love this from @adactio https://adactio.com/journal/19029 .

# Posted by Thain on Wednesday, May 4th, 2022 at 3:40pm

3 Likes

# Liked by Marty McGuire on Thursday, April 28th, 2022 at 12:22pm

# Liked by Egor Kloos on Wednesday, May 4th, 2022 at 4:43pm

# Liked by Adam Argyle on Wednesday, May 4th, 2022 at 4:43pm

Related posts

Handing back control

An emergent theme at An Event Apart Seattle 2019.

Directory enquiries

What if there were a categorised directory of resources for front-end dev?

CSS Day 2024

A genuinely inspiring event.

Progressive disclosure defaults

If you’re going to toggle the display of content with CSS, make sure the more complex selector does the hiding, not the showing.

Making the Patterns Day website

The joy of getting hands-on with HTML and CSS.

Related links

Tagged with

The Frontend Treadmill - These Yaks Ain’t Gonna Shave Themselves

Your teams should be working closer to the web platform with a lot less complex abstractions. We need to relearn what the web is capable of and go back to that.

Let’s be clear, I’m not suggesting this is strictly better and the answer to all of your problems. I’m suggesting this as an intentional business tradeoff that I think provides more value and is less costly in the long run.

Tagged with

It’s about time I tried to explain what progressive enhancement actually is - Piccalilli

Progressive enhancement is a design and development principle where we build in layers which automatically turn themselves on based on the browser’s capabilities.

The idea of progressive enhancement is that everyone gets the perfect experience for them, rather than a pre-determined ��perfect” experience from a design and development team.

Tagged with

Popover API Sliding Nav

Here’s a nifty demo of popover but it’s not for what we’d traditionally consider a modal dialog.

Tagged with

An origin trial for a new HTML <permission> element  |  Blog  |  Chrome for Developers

This looks interesting. On the hand, it’s yet another proprietary creation by one browser vendor (boo!), but on the other hand it’s a declarative API with no JavaScript required (yay!).

Even if this particular feature doesn’t work out, I hope that this is the start of a trend for declarative access to browser features.

Tagged with

Previously on this day

4 years ago I wrote Modified machete

The viewing order for a Star Wars movie marathon

9 years ago I wrote 100 words 037

Day thirty seven.

14 years ago I wrote June

There is nothing in this world more bitter than Spring.

15 years ago I wrote The Death and Life of Geocities

Geocities is no longer here for you to use.

16 years ago I wrote Loosely joined

What to do with those small pieces.

19 years ago I wrote Possible Amazon redesign in the pipeline

It looks like I’ve been chosen as a guinea pig for a design that Amazon is considering. Changes like these are usually served up on a small subset of Amazon’s servers. It’s then delivered to a correspondingly small subset of visitors.

19 years ago I wrote Introducing Adactio Elsewhere

I mentioned a little while back that there seems to be more and more bits of me scattered around the internet. My photos are on Flickr, my wishlist is on Amazon, my links are on Del.icio.us and my events are on Upcoming.

22 years ago I wrote NRA Takes Credit for Bush's Win

This report on the NRA’s 131st annual meeting sounds like something from The Onion.