What Exactly Is Green Coding, and Does GenAI Make It Easier? An Interview With Max Westing From the “Green Coding” Project

© RESET / Benjamin Lucks

Energy-efficient websites, apps and software reduce our digital carbon footprint. Max Westing from the ‘Green Coding’ project tells us what makes green coding different.

Author Benjamin Lucks:

Translation Kezia Rice, 04.08.26

Did you know there’s an eco-label for software? The ‘Blue Angel for Software’ recognises solutions whose programme code is particularly resource- and energy-efficient. So if there are ways to make programmes and websites more sustainable, why isn’t this the norm? And how does green coding actually work?

Our interview with the ECO:DIGIT project showed just how complex it is to measure the environmental impact of software. This is mainly because software and websites are no longer run solely on end devices, but also in data centres. For users, the advantage is that we no longer have to wait for a DVD in the post for a film night, or connect hard drives containing our video collection.

We asked Max Westing from Trier University of Applied Sciences whether green coding is similarly complex and how programmers can integrate sustainable practices into their work.

Max, how do you actually write software?

It’s quite complicated and difficult to answer that because there are always different levels of abstraction. At the end of the day, you usually program in a development environment where you produce your source code.

Nowadays, this is quite often done using generative AI. However, you are always generating code that is readable by humans but is translated into code that machines can execute. And there are different levels of abstraction—that is, languages that are closer to or further from machine code than others.

A good example of this is Python: the standard implementation is of the computer language C. So when we run Python code, it is translated into C code. And this C code is then, via a few intermediate steps, translated into machine code—that is, into the sequence of zeros and ones that computers can process.

So what exactly are these ‘code libraries’ that you keep reading about?

When you load a code library into a development environment, it is ultimately source code. In this case, however, it consists of objects that are made available to the system and call specific functions. This saves you the trouble of having to re-implement certain functions time and time again.

A so-called ‘library’ is like a standard component that you fit into your car. Except that, with software, it is something intangible that is not consumed, but can be incorporated time and time again.

In terms of software sustainability, this is precisely what makes it interesting. Because there are sometimes significant economies of scale here. For example, if you have a truly efficient library that becomes widely adopted, the efficiency gains from that single library can be replicated millions of times over on devices running that source code.

Video games are run on software too: economies of scale with the Sustainable Games Alliance

Our interview with the Sustainable Games Alliance once again highlights how such economies of scale can play out in practice.

Maria Wagner and Jiri Kupiainen from the Sustainable Games Alliance explain how simply reducing the resolution of a menu in the video game “Fortnite” demonstrated significant potential for sustainability. The reason: Fortnite has over 650 million registered players worldwide!

For each individual, the lower resolution may only lead to small savings in energy consumption. But when applied to millions of players, this adds up to significant overall savings.

The question of where code is executed is also an interesting one here. After all, there are an incredible number of deployment strategies where devices are configured on a large scale. In this context, you set up reproducible systems that can be reused time and again, so you don’t have to do everything manually. And if you can make adjustments there that yield small efficiency gains, then that scales up significantly.

Fascinating! Are there any guidelines on how to design such systems as efficiently as possible?

One thing you should definitely bear in mind is the type of software you’re developing and which part of the software you’re working on. On the one hand, there’s the backend, for processes hidden from users. [Editor’s note: This is the administrative area where developers make changes to websites or software.] Here, the focus is partly on performing calculations more efficiently.

However, efficient software also depends on how people use it. If you don’t have to click around a software for ages to find things, you spend less time using it—and that in itself makes it more efficient in principle. Developers can therefore also design software in such a way that users are guided to be more efficient. After all, efficiency also means making the best possible use of available resources so that they are used as sparingly as possible.

Another interesting aspect is to consider when certain tasks need to be carried out. If, for example, I have a computationally intensive workload—say, if I want to make a climate forecast—then that requires a relatively large amount of computing time. And then I might consider whether I absolutely need these calculations immediately or within the next five hours.

If I need them within the next five hours, I can, for example, shift the computing power slightly if it’s raining at the moment. If the sun is due to shine in the next two hours, I can shift computationally intensive tasks to that time when as much renewable energy as possible is available via the grid and thus save on emissions.

This practice is called carbon-aware load shifting and is technically feasible. Unfortunately, however, I can’t tell you how widespread it is at the moment.

A similar concept, but for the web: grid-aware websites

The Green Web Foundation is currently implementing a similar principle on the internet:

Grid-aware websites adapt the way they display content based on the current electricity mix.

If this mix currently contains a particularly high proportion of fossil fuels, they will display a lighter version of the page.

That reminds me of the Grid-Aware websites from the Green Web Foundation. But are there any risks involved in sustainable coding?

Let’s imagine that some genius managed to make the available hardware twice as efficient as it is now. That would, of course, lead to huge savings in energy costs. However, this money is usually invested in new hardware. And so, naturally, there is no further gain in terms of sustainability.

Such rebound effects are often the problem. The miniaturisation of devices alone—the fact that virtually everyone has a smartphone, for instance—means that technology is becoming more widespread and things like language models are being used more frequently. This alone has significantly lowered the barrier to consumption in recent decades.

Max Westing works in the Department of Environmental Planning and Environmental Engineering at Trier University of Applied Sciences. He has also contributed to the Green Coding project run by the German Informatics Society.

In the past, if we wanted to watch a film, we had to go to the cinema. That involved a consumer choice where you had to pay money, and in return, you got two hours of entertainment. Today, for example, most people have a Netflix subscription, and that’s just part of the consumption decision. At the same time, however, they also have Disney+ or other streaming services. This lowers the barrier to consuming more, as consumption is less conspicuous and content is more easily accessible. Consequently, much more is consumed, which increases our digital carbon footprint.

You mentioned language models a moment ago and also said that a lot of coding is now done using generative AI. What do you think the environmental impact of so-called ‘vibe coding’ will be?

Last year, I co-authored a paper in which we had an AI agent solve some relatively simple problems. We then gave it a few attempts to further optimise the code for energy efficiency. And in a way, that actually worked.

However, it is still difficult to determine what constitutes the quality or ‘standard’ of efficient code. So: what constitutes good code, and how often does one actually come across it in the ‘wild’? After all, there are plenty of developers who do not produce efficient code, either because they do not have the time or because they simply did not need to and therefore never learned how. Consequently, it is difficult to say whether human-written or machine-generated code is more efficient.

Want to find out more about green coding? Here are some useful links!

We also asked Max Westing for some further links on the topic of green coding. So if you’d like to find out more, take a look here:

What can be said at present is that AI systems that generate code consume a great deal of energy. This is partly due to their training and partly due to the hardware they run on, which is very resource-intensive. However, I am not currently aware of any comprehensive life-cycle analysis that compares whether a developer or an AI agent produces more efficient code.

Green digital futures

How can we ensure a green digital future?

Growing e-waste, carbon emissions from AI, data centre water usage—is rampant digitalisation compatible with a healthy planet? Our latest project explores how digital tools and services can be developed with sustainability in mind.

If we assume that developers gain in efficiency when they use AI tools, as they have more time to optimise their code, the question remains as to whether this offsets the costs of training and operating the AI.

That is why there are projects such as ECO:DIGIT, which, if they work well, can provide us with data on this topic.

Thank you for the interview, Max!

©
Energy-Efficient Software and Web-Friendly Websites: How Green Coding Works

If the internet were a country in its own right, it would rank sixth in the global CO₂ emissions rankings. Under the banner of ‘Green Coding’, we’ve put together some ways you use the internet more resource efficiently.

Browser Diet: JustTheBrowser Removes AI and Shopping Features from Chrome, Firefox, and Edge

The "JustTheBrowser" tool lets you strip Google Chrome, Mozilla Firefox and Microsoft Edge of unnecessary bloat. RESET shows you how to get rid of AI features, shopping integrations and more.

© RESET.org
Eco:Digit Shows How the Environmental Impact of Software Can Be Measured

The ECO:DIGIT project—led by the German Informatics Society (GI) and its partners—highlights just how complex a life cycle assessment for software has become.

Miniaturisiertes photonisches Modul
© Fraunhofer HHI
Data Centres, Telecommunications Networks, AI Infrastructure: Photonics Offers Clear Advantages for Energy Efficiency

Photonics could drive the green digital transformation, says David de Felipe Mesquida from Fraunhofer HHI in his interview with RESET.

Tracking CO2 Emissions Right From the Coding Stage: Carbonara Takes an Early Approach to Green Coding

Not all code is created equal. The Carbonara tool helps developers code sustainably by estimating how much CO2 their programmes will generate.

Interview: How to Break Free From Google’s Browser Monopoly

Reading on Google Chrome? This interview with Andy Davies from Wholegrain Digital might make you change your browser. Here's how sustainable alternatives can fight Google's monopoly.

Emissions From the Semiconductor Industry Appear to Be Rising Due to the AI Boom (Update)

A new study on the ecological footprint of the semiconductor industry suggests that the ongoing AI boom is also leading to rising emissions in this sector. Interface is now launching the Semiconductor Emissions Explorer as a new web app in the form of a microsite.

Screenshot der verschiedenen Designs der Webseite von Branch.
© Branch Magazine
Grid-Aware Websites Respond to the Power Grid

Lean websites and green servers reduce CO2 emissions of the internet. Grid-aware websites go one step further: they adapt to the power grid.