asim.dev

CAT Salon: Digital Sustainability Part 3 – Green Software Engineering

CAT Salon 2021 · Online

by Asim Hussain · 23 March 2021

talk tech green
CAT Salon: Digital Sustainability Part 3 – Green Software Engineering
▶ Watch on YouTube ↗

I gave this talk to the ClimateAction.tech community — fellow tech professionals already convinced the climate crisis is real — so for once I could skip the climate-change preamble and dig straight into the Principles of Green Software Engineering. It’s the early, foundational version of the Principles, told through the things I had to teach myself first: that electricity is dirty, that carbon moves around, and that the laptop in front of you already cost the planet something before you switched it on.

AI-generated summary of my talk

Jump into the talk

  1. 0:00 Cloth nappies and my green epiphany
  2. 2:01 Why principles.green exists
  3. 4:02 The two philosophies
  4. 10:06 Carbon: don't waste it (petrol vs EV)
  5. 15:11 Electricity is dirty — and the solution
  6. 22:16 Carbon intensity: by region and by time
  7. 28:23 Embodied carbon and the heckler in China
  8. 36:27 Q&A: convincing decision-makers, and why policy wins

How I got here: cloth nappies

My way in wasn’t a spreadsheet, it was my son. I was willing to deal with cloth nappies — the washing, the mess, all of it — and one day it struck me that I’d happily put up with that at home, yet I’d never once asked the equivalent question about my actual job. I’m a software engineer. How do you build software that’s green? What does “green” even mean when it’s just code? That question started a long journey that eventually became a role at Microsoft and, more importantly, became principles.green: eight first principles, the things you genuinely need to know to build software responsibly that nobody teaches you — not in a coding bootcamp, not at university, not anywhere. I tried to condense them so you can drop in, learn what matters in about thirty minutes, and apply some of it in your day job.

The two philosophies

Before any of the principles, two beliefs underpin everything. The first is that everybody has a part to play. There’s an old Ogilvy report, Mainstream Green, that splits people into super-greens, middle-greens and rejecters — and roughly 16% across all of tech genuinely care, scattered across front-end, back-end, machine learning, design, databases, everywhere. The mistake we kept making was to find the one or two people who could “make the biggest difference”, advise them, and leave the other 16% with nothing to do. That’s not how you change an organisation. You change it by giving everyone, whatever their domain, something concrete to do.

The second is that sustainability is enough on its own. The moment a conversation gets hard, it’s tempting to reach for an easier argument — “it’s also cheaper”, “it’s also faster”. And it’s true: green software is almost always cheaper, faster and more resilient. But those are happy side-effects, not the reason. Lean on them and you lose people the day the cost case wobbles. This is a cultural change, and the culture has to value the thing itself.

Don’t waste carbon

My framing for the carbon principle is waste. No matter what we do, we emit carbon — so the goal is to get the most value we can out of every gram. The clearest illustration is petrol versus electric. Turning oil into petrol throws away about half the energy; getting it to the car loses more; and an internal-combustion engine is only around 20% efficient at converting fuel into forward motion — so you end up using roughly 8% of the energy and wasting the rest. An electric vehicle loses very little between the source and the wheels. That’s the real reason an EV is green: it isn’t magic, it’s just far more efficient at turning energy into useful work. Green software is the same idea — the same value to the user, less carbon spent getting there. And once you look at your application through that lens, options appear that you’d simply never thought of, often with no impact on the user at all.

Electricity is dirty — and it’s the way out

This was the part that genuinely humbled me. You plug something into a wall and there’s no smell, no dirt on your hands, so electricity feels clean. It isn’t — it’s one of the dirtiest things on the planet, because most of it still comes from burning fossil fuels, coal especially. I’m an engineer whose entire career runs on a laptop, and I didn’t understand the thing that powers it; it might as well have been magic juice. So the principle here is to be energy efficient — because you can draw a straight line from electricity back to carbon. But the same fact is also hopeful: the clean energy theoretically available to us, from wind and especially solar, vastly exceeds what the world actually uses. Electricity is the problem and the solution at once.

That leads into carbon intensity — how clean or dirty a unit of electricity is, measured in grams of carbon per kilowatt-hour, and it changes both by region and over time. France runs very clean because it’s mostly nuclear; other grids lean on coal. And because the grid has almost no storage, intensity swings through the day as operators burn more gas or coal to balance demand. Tools like electricityMap show you this live, and the carbon-intensity APIs — the UK’s free carbon-intensity service, WattTime in the US, electricityMap — even forecast it. So if you’ve got a batch job that doesn’t care whether it runs now or in an hour, you can shift it in space or in time to when the grid is cleaner. That’s the third principle: consume electricity with the lowest carbon intensity.

The heckler, and embodied carbon

I once gave an earlier version of this talk in a packed room, and afterwards a man waited patiently for half an hour, then said, “Great talk, but I couldn’t believe a word of it because you use a laptop built in China,” and stormed off. It baffled me for a while — but he wasn’t wrong. There’s a thing called embodied carbon: every device emits carbon being made and being destroyed, separate from the electricity it uses running. For my phone, on the UK’s fairly clean grid, the carbon already baked into building it likely outweighs everything it’ll emit being charged across its whole life. For a server in the cloud the equation flips the other way. The lever for us as engineers is lifespan: you amortise that embodied carbon over the years a device lasts, so stretching a four-year life to five meaningfully cuts the yearly impact. And mostly we don’t throw hardware away because it broke — we throw it away because our software keeps making it obsolete, and we keep getting lazier as the hardware gets faster. So the principle is to be hardware efficient.

Q&A: how change actually happens

The questions turned to tactics, and my honest answer surprised a few people. You don’t need to convert the cautious middle — you need to convince a decision-maker who already cares, and there’s always a bigger fish, so keep going up the chain until you find one. Then give them an argument they can use to defend their decision to back you, which is a different and lower bar than an argument that convinces others. Mine at Microsoft was simply that this is a competitive edge over Amazon — not airtight, but enough to defend a “yes”. I also leaned on moral psychology: get someone senior to plant a flag, and people who’d never act on climate grounds will fall in line rather than subvert leadership.

When someone asked what really moves companies, my answer was policy. Appealing to consumers only works in aggregate — one person walking away changes nothing. Greed and fear both bend organisations a little, but the threat of regulation bends them far more than either the carrot of saving money or the stick of losing it. So if you want to use your voice as an individual, the most powerful thing you can do is help drive policy — and demand standardisation, like requiring software to report its energy metrics in real time.