Green Coding: How Coders Can Contribute To A Greener Environment
It was only a few months ago when I was attending the Open Source India Conference that I came across the term ‘Green Software’ for the first time. It’s a relatively new term that’s come up in recent years to encourage software engineers to write code and design systems in an optimum way that reduces energy consumption and helps in the creation of a greener environment.
Now some might argue — Is green coding really needed in the first place when technology in itself is responsible for replacing many real world processes that would have a much higher carbon footprint otherwise?
Green coding isn’t positioned to change software engineering at its root but to inculcate a mentality among software engineers to implement greener principles along with existing software engineering practices such that functionality is balanced with energy usage.
On looking further I found out that a study had been conducted a few years ago by a group of Portuguese researchers who had set out to determine which are the greenest programming languages in terms of energy efficiency out of 27 of the most popular programming languages used today.
The results of the study were as follows -
Most energy efficient languages — C, Rust, C++, Ada, Java
Least energy efficient languages — Ruby, Python, Perl
Look at the table below for more detailed results —
So what do we mean by Green Software Engineering?
Green Software Engineering is an emerging discipline that is at the intersection of climate science, software practices, hardware, data center design among other things. The Green Software Foundation, a non-profit under the Linux Foundation is creating an ecosystem of standards and best practices for green software. Several companies like Accenture, Microsoft, Intel, GitHub, Goldman Sachs, Shell, MasterCard, VMWare among others are an active part of the foundation to imbibe a DNA of sustainability in the software that they build.
Why is Green Coding needed?
- GHG emissions from digital technologies has grown by 1.2% globally since 2013.
- The exponential growth of cloud service has resulted in massive expansion of intensive data centers that consumes electricity. The energy demand from data centres has grown by 4 times since 2013.
- Apart from energy efficiency, green coding also helps businesses with sustainability and SEO.
- The University of Cambridge estimated that 115 TWh energy is needed to maintain the Bitcoin network. This is twice the energy consumption of the entire nation of Switzerland.
A report by the Global e-Sustainability Initiative estimates that IT solutions, which we call ‘greening by IT,’ can help cut nearly 10 times more CO2 than they emit.
Finally, what can those involved in the Software Engineering field do for Greener Software?
- Since processing each line of code leads to energy consumption, writing optimised code keeping time and space complexity in mind can lead to better energy efficiency.
- Refactoring the code. Identifying unused features and removing them. Identifying most used and high power consumption features and working on making them emit lesser emissions. This also helps in maintaining the software.
- Modern chipsets come with inherent energy management capabilities that can be exploited to reduce energy use. Tracking fugitive emissions using sensors.
- Adopting lean and agile methods of working makes green software development easier.
- The efficiency can also be improved with the quality of virtual machines, compilers, optimized libraries, and better source code.
- Adopting efficient cache policy, minimising data exchange, and managing the lifecycle of stored data. Compressing data/media before their transmission whenever possible.
- Configuring computation to be triggered on-demand of the user.
- As we saw from above, the choice of programming language can also influence the energy efficiency of a software.
Let’s conclude by looking at a few examples ….
- Intel offers developers tools and resources for managing energy consumption. The company has a Software Development Assistant to help engineers gauge the energy measurement of the workloads they deploy.
- Microsoft is working on zero waste so that nothing goes to the landfill.
- By 2025, Microsoft also plans to run all its data centers on renewable energy. It has partnered with Shell for cloud sustainablity.
- AWS is slated to power its complete digital operations using green energy by 2025.
- Adobe is working on using wind and solar energy to fuel its digital operations and plans to be supported only by renewable energy by 2035.
We have reached a time that demands urgent action to preserve our environment from the irreversible effects of climate change. And green software can be one of the ways to make a meaningful contribution to saving the planet, especially in this technology-driven world.
That’s all! Thanks for reading the entire way! Do leave your feedback.😄
You can also connect with me on:
LinkedIn: https://www.linkedin.com/in/spreehadutta/
Instagram: https://www.instagram.com/spreeha.dutta/
Twitter: https://twitter.com/DuttaSpreeha
GitHub: https://github.com/Spreeha
Mail: spreehadutta@gmail.com