Blog

Blog Image

Green Coding

The beginning of June marked World Environment Day and with us all making changes to help combat climate change, I wanted to delve into ‘green coding’. 

Firstly, here’s some facts for you to put in perspective the growth and effect of data and data use on the world. Data consumption is 38 times greater than it was 10 years ago. The digital systems we use consume 10% of the world’s total energy consumption. And crucially, they contribute to 4% of greenhouse gas emissions. Data consumption keeps on growing and there is no stopping that, but there is something we can do about helping to decrease the damage to the environment. 

Hardware is becoming more energy efficient and now it’s time for the software to keep up as it has a significant impact on overall energy consumption. Research done by the University of Cambridge gives us a real world example of this; the energy that is needed to maintain the Bitcoin network is about 115 terawatt-hours (TWh). This is roughly double the energy consumption of the whole of Switzerland!

Most companies today have a department or initiative that is dedicated to combating climate change. It is part of a corporate responsibility that we all should be sharing. This means that software engineers too should be doing their part. In comes ‘green coding’. 

What is ‘green coding’?

Sustainable coding or ‘green coding’ refers to code that is written and used in a way that minimises energy consumption. 

Software development can often lead to codes, files and software that is no longer wanted by the user. All of this is known as ‘bloatware’ and takes up unnecessary space on the computer’s hard drive, creating a high demand on the resources to operate. The processor on the computer then needs to make more calculations than it would with simpler software. This leads to a higher energy consumption and more carbon dioxide emissions. 

Green coding can also be used on mobile devices to maximise power, increase battery life and generally combine resources to solve a task more efficiently. Applications can also be developed to decrease the need for use of paper, plastics and waste materials. 

By storing things in the Cloud, we have reduced the physical waste accumulation. However, this has meant that there is a pile up of digital waste. This is a simple fix though, by the user regularly deleting useless and unwanted files. A small ask, but if we all did it, it would make a huge difference.  The Global e-Sustainability Initiative estimated that green coding solutions can help to cut almost 10 times more CO2 than they emit. 

Software on its own doesn’t harmfully consume energy, the problem arises in the way that it is developed for use, and thus the way it is used. 

Within green coding there are two considerations that can be made; structural and behavioural. 

Structural

Structural coding considerations are the measure of energy directly related to making the units of code. Programmers have started using a tool called ‘Big O notation’ to maximise performance and calculate the efficiency of their coding algorithms. In short, Big O notation is used to describe the performance of an algorithm. It does this by describing the worst case scenario and describing the execution time/space required by the algorithm.  

Behavioural

Behavioural considerations would be how much energy is used by the end user. For example, the process of checking an email or posting on Instagram. 

There is a lack of examples of obviously ‘green’ and eco-friendly coding. This doesn’t mean that there is a lack of effort though. Coding is what has led the development of eco-friendly and green apps that offer more efficient replacements of real world processes. For example, online applications that employees can log their timesheets instead of paper.  

The key thing to remember is that green coding doesn’t object to the current efficient software engineering practices. It actually is an enhancement and valuable integrative feature for them. 

Here at Codeminers we are always working towards our green coding initiative and would love to help you fulfil your corporate social responsibility by becoming more efficient and employing the best eco-friendly methods for your digital needs. If you would like to talk to us and find out more then get in touch with us below.

References;

“Green coding: sustainability in software”. Ramesh, K. Oct 2020

“A beginner’s guide to Big O notation”. Bell, R. June 2009

“Green coding: the digital industry’s solution to sustainability?” 

“Principles of green software engineering”. Hussain, A

Image via source

  • Written by Mikita Maru, June 07 2022