Green coding: another contributor to IT sustainability

Green coding
Sheila Zabeu -

May 29, 2023

In times when sustainability and resource optimization are frequently mentioned in IT environments, a concept is also gaining space, that of green software development or green coding.

What had been happening until a few decades ago is that there were technological constraints, such as limited processing power and bandwidth, which required developers to pay more attention to reduce the size and complexity of the generated codes. With the advancement and increased availability of hardware resources, this care has largely been set aside. Today, with sustainability in vogue, this attention has re-entered the scene in the form of green coding.

Considered a segment of green computing, green coding is a practice that seeks to minimize the energy involved in processing lines of code and thus help organizations reduce overall energy consumption and greenhouse gas emissions. When they started thinking about IT sustainability, these organizations addressed topics such as green energy, hardware efficiency and electronic waste treatment, but only now is efficient software development entering the pack again.

Founded in 2021, the Green Software Foundation is working to build a trusted ecosystem of people, standards, tools and best practices aimed at contributing to sustainable software development. The intention is to change the culture of creating lines of code in a way that makes sustainability a centerpiece for developer teams as important as performance, security, cost, and accessibility.

In this endeavor, the foundation emphasizes that green software development covers its complete life cycle, i.e. creation, operation, and disposal (reuse). It makes some recommendations to help this process concentrated in four areas: design and coding options, choice of programming language, selection of Artificial Intelligence models and software development.

Design and coding options: (1) Maintain focus and control of the most power hungry resources and common usage scenarios; (2) Reduce data usage; (3) Remove unused resources; (4) Detect and remove loops that fail to achieve the intended goal; (5) Adapt application software behavior according to device power mode or other operating conditions; (06) Limit computational accuracy to the desired level; (7) Monitor application power consumption in real time to identify modules that can be optimized.

Choice of programming language: (8) There are several factors to be considered, so the recommendation is to make a detailed evaluation, considering the most relevant criteria, such as power consumption, speed, and memory usage.

Artificial Intelligence model selection: (9) These models can be more sustainable if they have been developed and used by consuming less power and sharing reproducible code to reduce duplicate efforts; and rely on specialized hardware optimized for AI workloads.

Software development: (10) Monitor energy consumption in real time during development, using techniques such as dynamic code analysis.

Earlier this year, Microsoft published a white paper describing its work together with environmental technology non-profit organization WattTime promoted through the Green Software Foundation. Together, they pioneered the first carbon recognition application for businesses and opened up the source code of the tools and architecture.

The two organizations are also contributing to the development of a new specification known as Software Carbon Intensity (SCI), aimed at measuring the carbon impact of software systems. They have also created and open sourced development kit code that helps run software when and where energy is cleanest. The combination of these two projects will enable developers to “decarbonize” software.

Energy sinks

Sustainability in software and data architectures has not been a priority for enterprises, partly due to several misconceptions, points out consultancy Mckinsey. Many IT leaders believe that the energy footprint of software is almost negligible or is already sufficiently optimized. Because of this, software development is often overlooked when thinking about energy efficiency, incurring unnecessary costs due to more complexity and less performance.

According to McKinsey, there are five patterns that result in energy-inefficient software and data architectures. Developers need to focus on these below that present optimization gaps in terms of maintainability, reusability, performance, and functionality.

five patterns that result in energy inefficient software and data architectures

To significantly reduce the overall software and data footprint, it is recommended to address the underlying sources of emissions by considering the three factors shown in the following chart.

 three factors to reduce emission sources