Our world is changing. Our environment is changing. This calls for a change in our pattern of consumption to reduce our impact on the earth. Clients and companies should be part of this change; green coding is one means to that end.
Is programming, building and running software and using digital medium perfect in the way that they use carbon resources? Unfortunately, for the internet (and all those applications that we use online) to function properly, they need to be hosted in data centres, which currently account for 0.3% of all global CO2 emissions.
According to Grant’s Tech CEO, H. Abderrazak, “Every action performed on a computer has a carbon footprint, however small it may be. Renting an electric car or booking a table at your favourite organic restaurant requires computer applications/websites and therefore code.
Each application uses a set of energy-intensive components: the computer processor, the internet connection, the physical servers, the cloud, etc.
Depending on the quality of the code, the call to these different components will not be made in the same way and the footprint of this digital service will be completely different. Indeed, a poorly written code will require a longer execution time, will make several calls to the servers and will have a higher energy footprint.”
And what’s even worse, it is estimated that by 2040 it will increase to 14% of global emissions.
With this predicted increase, environmental and sustainability advocates in the space are introducing a new term called low-carbon coding, or green coding, which is essentially a new mindset to adopt when building code. Even though there are multiple definitions and uses of the terms by individual contributors and companies, GFT Group developed a framework to define the principles of green coding based on architectural principles and supported by three pillars: the logic, methodology and platforms used to write, develop and run the code.
For each of the pillars, they have developed a set of principles that guide behaviours to a more sustainable approach to programming, including writing more efficient code (requiring fewer lines of code), using programming languages that are lighter and use less power to run, and being cognizant of what features are heavier to load to limit its usage.
Grant’s Tech’s CTO, D. Fekih discusses the individual versus the organisation’s role in carbon-efficient coding, “While it is most certainly not on individuals to mitigate climate change, it is definitely essential to take actions that make a positive impact on the environment.
“Sustainable software design requires one to be more environmentally conscious while making decisions and setting the architecture such as choosing the programming language to use, prioritising the performance optimization, estimating the energy consumption or using automatic debugging.
“Choosing the right programming language is the first step a programmer should make as it has an impact on the application performance, the hosting environment and the hardware compatibility. Programmers should build software that outlasts hardware updates which will lead to reduced electronic components and device waste. These are few tweaks and programmers can get involved with sustainable tech movements and contribute to different open-source projects.”
Companies like Microsoft are launching initiatives to develop this idea further and make green coding a reality in the tech industry. In 2021 Microsoft launched The Green Coding Foundation to “set standards, best practices and patterns for building green software,” as well as grow an international community of green software ambassadors.
So, are companies, coders and clients all on the same page about carbon-efficient coding? Not quite so.
W. Benghodhbene, Business Development (Europe and North Africa) at Grant’s Tech believes there is still a long way to go. “Our world is changing. Our environment is changing. This calls for a change in our pattern of consumption to reduce our impact on the earth.
Clients and companies should be part of this change; green coding is one means to that end.
“Our clients are quite receptive to the concept and want to act responsibly but there are still some barriers to entry. The cost is the main one. It takes lots of time and research: change management, training, etc. and to have a purist approach, the application thus developed will have to be hosted in a green cloud data centre which remains relatively expensive. The involvement of major players such as AWS, Microsoft and Google in this process will make it possible to offer a more affordable offer.”
As with all developments in sustainability, there is always a risk of a novel idea losing steam due to resistance in its application and surface-level use of the concept to boost a company’s goodwill (also known as ‘green-washing’). So will green coding remain a fad or will it penetrate coding and software development norms?
H. Abderrazak and his team of coders at Grant’s Tech champion the shift toward energy-efficient coding – “An optimized code with a different architecture will be less greedy from an energy point of view and will be considered green. In addition to that, a well-written code is more efficient and will have a positive impact on the user experience. It’s a win-win approach.
“Green coding shouldn’t be a fad. It should be adopted by all the economic players to take it to the next stage allowing its democratization”