Responsibility

My colleague Chris has written a terrific post over on the Clearleft blog: Is the planet the missing member of your project team?

Rather than hand-wringing and finger-wagging, it gets down to some practical steps that you—we—can take on every project.

Chris finishes by asking:

Let me know how you design with the environment in mind. What practical advice would you suggest?

Well, here’s something that I keep coming up against…

Chris shows that the environment can be part of project management, specifically the RACI methodology:

We list who is responsible, accountable, consulted, and informed within the project. It’s a simple exercise but the clarity is useful for identifying what expertise and input we should seek from the named individuals.

Having the planet be a proactive partner in your project ensures its needs are considered.

Whenever responsibilities are being assigned there are some things that inevitably fall through the cracks. One I’ve seen over and over again is responsibility for third-party scripts.

On the face of it this seems like another responsibility for developers. We’re talking about code here, right?

But in my experience it is never the developers adding “beacons” and other third-party embedded scripts.

Chris rightly points out:

Development decisions, visual design choices, content approach, and product strategy all contribute to the environmental impact of your website.

But what about sales and marketing? Often they’re the ones who’ll drop in a third-party script to track user journeys. That’s understandable. That’s kind of their job.

Dropping in one line of JavaScript seems like a victimless crime. It’s just one small script, right? But JavaScript can import more JavaScript. Tools like Request Map Generator can show just how much destruction third-party JavaScript can wreak:

You pop in a URL, it fetches the page and maps out all the subsequent requests in a nifty interactive diagram of circles, showing how many requests third-party scripts are themselves generating. I’ve found it to be a very effective way of showing the impact of third-party scripts to people who aren’t interested in looking at waterfall diagrams.

Just to be clear, the people adding third-party scripts to websites usually aren’t doing so maliciously. They often don’t realise the negative effect the scripts will have on performance and the environment.

As is so often the case, this isn’t a technical problem. At root it’s about understanding people’s needs (like “I need a way to see what pages are converting!”) and finding a way to meet those needs without negatively impacting the planet. A good open-minded discussion can go a long way.

So I echo Chris’s call to think about environmental impacts from the very start of a project. Establish early on who will have the ability to add third-party scripts to the site. Do all of those people understand the responsibility that gives them?

I saw this lack of foresight in action on a project recently. The front-end development was going really well and the site was going to be exceptionally performant: green Lighthouse scores across the board. But when the site went live it had tracking scripts. That meant that users needed to consent to being tracked. That meant adding another third-party script to generate a consent banner. It completely tanked the Lighthouse scores.

I’m sure the people who added the tracking scripts and consent banners thought they had no choice. But there are alternatives. There are ways to get the data you need without the intrusive surveillance and performance-wrecking JavaScript.

The problem is that it’s not the norm. “Everyone else is doing it” was the justification for Flash intros two decades ago and it’s the justification for enshittification via third-party scripts now.

It doesn’t have to be this way.

Responses

blog.jim-nielsen.com

From Jeremy Keith’s piece “Responsibility”:

Dropping in one line of JavaScript seems like a victimless crime. It’s just one small script, right? But JavaScript can import more JavaScript.

“It’s just one line of code” is a pitch you hear all the time. It might also be the biggest lie we tell ourselves — and one another.

“Add styles with just one line”:

<link href="styles.css" rel="stylesheet">

“Add our widget, it’s just one line”:

<script src="script.js"></script>

“Install our framework in just one line”:

npm i framework

But “just one line” is a facade. It comes with hundreds, thousands, even millions of lines of code. You don’t know how many and it’s not usually disclosed.

There’s a big difference between the interface to a thing being one line of code, and the cost of a thing being one line of code.

A more acute rendering of this sales pitch is probaly: “It’s just one line of code to add many more lines of code.”

The connotation of the phrase is ease, e.g. “This big complicated problem can be solved with just one line of code on your part.”

But, however intentional, another subtle connotation sneaks in with that phrase relating to size, e.g. “It’s not big, it’s just one line.”

But “one line” does not necessarily equate to small size. It can be big. Very big. Very, very big. One line of code that creates, imports, or installs many more lines of code is “just one line” to interface with, but many lines in cost (conceptual overhead, project size and complexity, etc.).

The next time you hear “it’s just one line” pause for a moment. Just one line for who? You the developer to write? Future you (or your teammates) to debug and maintain? Or the end-user to download, parse, and execute?

# Monday, June 3rd, 2024 at 7:00pm

2 Shares

# Shared by roland on Wednesday, May 15th, 2024 at 1:59pm

# Shared by Tom 〠 :code: :verified: on Wednesday, May 15th, 2024 at 2:33pm

1 Like

# Liked by roland on Wednesday, May 15th, 2024 at 1:59pm

Related posts

Writing on web.dev

A new free course on responsive web design.

Prediction

What I’m hoping for in 2021.

Third party

Imagine a web where cookies and JavaScript had to be self-hosted.

GDPR and Google Analytics

Do you have permission for those third-party scripts?

Speedy tunes

Improving performance on The Session.

Related links

Counting Ghosts

Analytics serves as a proxy for understanding people, a crutch we lean into. Until eventually, instead of solving problems, we are just sitting at our computer counting ghosts.

This article is spot-on!

Tagged with

I don’t want your data – Manu

I don’t run analytics on this website. I don’t care which articles you read, I don’t care if you read them. I don’t care about which post is the most read or the most clicked. I don’t A/B test, I don’t try to overthink my content.

Same!

Tagged with

No To Spy Pixels

Almost no-one has given informed constent to being tracked through spy pixels in emails, and yet the practice is endemic. This is wrong. It needs to change.

Tagged with

Bunny Fonts | Explore Faster & GDPR friendly Fonts

A drop-in replacement for Google Fonts without the tracking …but really, you should be self-hosting your font files.

Tagged with

Ban Online Behavioral Advertising | Electronic Frontier Foundation

Targeted advertising based on online behavior doesn’t just hurt privacy. It also contributes to a range of other harms.

I very much agree with this call to action from the EFF.

Maybe we can finally get away from the ludicrious idea that behavioural advertising is the only possible form of effective advertising. It’s simply not true.

Tagged with

Previously on this day

1 year ago I wrote Hosting DIBI

On stage in Edinburgh.

2 years ago I wrote Image previews with the FileReader API

Adding `alt` text to uploaded images.

3 years ago I wrote The cage

Responding to a very bad take on surveillance capitalism.

8 years ago I wrote Content Buddy

Making myself available for proof-reading, editing, and general content wrangling.

9 years ago I wrote This is for everyone with a certificate

The browser beatings will continue until morale improves.

9 years ago I wrote 100 words 054

Day fifty four.

13 years ago I wrote Mobilism browser panel

Hats off to the conference, and hats off to the browser vendors who showed up.

22 years ago I wrote Attack of the Clones

I got my days mixed up yesterday. I’ll be seeing Attack Of The Clones sooner than I realised - midnight tonight.