Janne Kalliola - Green coding
Janne Kalliola is the founder and chief growth officer of the digital services agency Exove. He has recently published a book about sustainable coding, Green Code.
In this episode, we talk about the need for more sustainable coding practices, drawing on the main points from Janne's book. We discuss the impact of different data-intensive technologies, the differences between software versus hardware, the benefits of cloud computing, and the negative impact of advertising, before concluding with some key sustainable coding tips for businesses.
Links & mentions:
“We are part of the problem. That’s one of the things that, in software development, people don’t think that we are part of the problem, that we are part of the solution, because we have so big handprint as an industry that we reduce the emissions of the analogical industries with digital. But then we create a lot of digital emissions.”
Welcome to the Agile Digital Transformation Podcast, where we explore different aspects of digital transformation and digital experience with your host, Tim Butara, content and community manager at Agiledrop.
Tim Butara: Hello everyone, thanks for tuning in. Our guest today is Janne Kalliola, founder and chief growth officer of the digital services agency Exove. He’s recently published a book about green coding, and this is what we’ll be discussing today, so, the environmental impact of technology and how green coding practices can help here.
Janne, welcome to the show, thanks so much for being our guest. Do you want to add anything or should we just jump straight to our questions?
Janne Kalliola: Thanks, nothing to add. That was a very good intro, so let’s start with the questions.
Tim Butara: Awesome. The first thing that I want to talk about today is this double-edged sword of data and innovation. We usually treat new data-driven technologies as the be-all, end-all ultimate solutions without really considering potential long-term downsides enough, and stuff like environmental impact.
So, for example, if we compare something like IoT, so, the internet of things, on the one hand, and something like the metaverse on the other, both of these are super data-intensive. But they have wildly different implications for society and the future of humanity, right? What are your thoughts here?
Janne Kalliola: If we start from the environmental impacts – I don’t talk anything about related to society and so forth, that’s a topic for somebody else that better knows those topics than I do. Because the metaverse, for example, has also other impacts than just the environmental.
But the environmental sense, probably everybody knows already now the concept of carbon footprint and how much carbon emissions your service creates. And there’s also the concept of carbon handprint; that means how much your service or the thing that you are doing is removing carbon from your carbon emissions.
So, if you have, let’s say, an IoT is used in a steel mill, and then you can optimize the performance of the steel mill and you can reduce the amount of energy used to heat the steel, for example, you will have a huge carbon handprint, because you’ve just reduced the emissions.
So, the IoT has a lot of these kind of possibilities to create a better world by reducing inefficiencies, removing bottlenecks and whatnot in industrial processes. And then the amount of emissions – IoT sensors, the logistics, the creation of the sensors and everything, and the software and the data that we then probably store for long periods of time and analyze it for the longer trends and whatnot, that has a huge positive impact.
On the other hand, then, discussing about metaverse or the cryptocurrencies, they will use a huge amount of data and then also a huge amount of transmission capacity for achieving something that most probably doesn’t really bring that kind of huge energy savings; in some cases, it might be just completely pointless, like a solution that is looking for a problem.
They don’t add up anything. I and you, if we would meet in metaverse, we would not need to travel. On the other hand, whether the immersiveness of the metaverse would be better or way better than the call that we have now in Zoom – most probably not. Meeting together as avatars in some 3D space, at least I would be nauseous, most probably won’t really change the experience so much that it would make sense. And, for example, the cryptocurrencies, it’s really good for drug dealers and people that want to sort of get financial gains by speculation. And then for the rest of the planet, most probably the impact is completely (inaudible).
Tim Butara: I think another important distinction to make is also the difference in environmental impact between software versus hardware, right. Because we already kind of alluded to this with the talk about IoT, so yeah, what would you say here?
Janne Kalliola: There’s two different things there. There’s the cycle of the speed of how quickly we purchase new devices, how quick is the cycle of renewing stuff. And that has been mostly driven by marketing. So, it’s the best of Apple, Samsung, Google and the others manufacture their phones and the other devices, that people buy new devices. And they have created a lust. Most of the capital is run with that somebody creates a desire and then fulfills the desire.
And the devices, typically, would be usable for way longer period, but when there are new, more powerful devices, then the software easily eats– it’s like bureaucracy, it will always grow and it will always fill all the available space. So, the software demand will grow, and then you can’t run new software on an older device, because it’s just not performing that well.
But funnily enough, when you look at the, first you look at the people, we are still the same people that we were in the stone age. We are not any faster, we don’t process things any faster. And we were sort of satisfied in the 80s. I was growing up with the Commodore machines and we could play on this Commodore 16, and then Amiga.
And Amiga was the first device that I could perform a lot of things that I still do – write text, make drawings and this kind of things. Of course it’s not the perfect one, but it’s like 10,000 slower machine than my mobile phone. And I still do the same kind of things – I play games, I read emails, so forth. But the software is so bloated that we need to have faster devices.
And then the other area is that the people don’t really think that how much the device manufacturing, the logistics, getting the device to the right place, right hand, maybe some configurations, reinstalling everything to new device, what is the environmental impact of that?
And then when we have more data, we have more stuff to process, we have better screens, we have better cameras on the phones, but our eyes are still the same. And after, like, 300 DPI to 600 DPI, that’s something that I used to study back in the days; in the late 90s, I studied some part of the printing technology.
So, there’s somewhere there, 300 – 600 DPI, that the people’s eyes, they just don’t anymore see details. And when you are like me, I’m 50 already, you just see less and less details, I can assure you. So, what’s the point of having so densely packed screen that can show so big photographs?
Because the information that you see as the viewer of the photo is the same even if the photo would have one tenth of the data, because the information still is the same. Because you can’t see the details. Sometimes you can, maybe, yes, there are certain alterings, but most of the– let’s say that you have a family outing and then you take photos. Would you zoom in to see the sort of ear, hair or the pimples on the faces? What would be the reason to zoom in? There is no practical reason.
And of course, if there’s a photo of a stadium full of people, and you want to see that, yes, I’m here, I’m at that group of pixels looking at the band that’s playing there, then there might be a need. But for most of the photos, it doesn’t really matter. But it just increase, per 50 megapixel photos, and after like 4 or 6 I have been happy.
Tim Butara: So, on both sides it’s very complicated, right? You have, on the hardware side, and the interplay with software, we talked about planned obsolescence versus perceived obsolescence. So, planned obsolescence is kind of inevitable because of new, more demanding software requiring hardware changes. And then, perceived obsolescence, what you talked about, it being the fault of marketers.
This perceived obsolescence thing was also really interesting to me because of– you know, ok, you have iPhone, and you had iPhone 9, I guess, and then you had iPhone X, right. It moved by one. But then Huawei, you had Huawei P20, and then the next year P30 came out. And suddenly it looked like you were ten versions behind, not just one version behind. So, definitely a lot of things to consider here.
Janne Kalliola: And then one thing that I want to add that is one of the points in my book, that if the software would be written with quality fashion and focused on the ecological impact, there would be no need to update the devices. We would be happy with, let’s say, ten year old phones. Because they would just run fine.
But now the performance increases are wasted, partially because the software developers are lazy and they use the libraries, they don’t really optimize software, because that doesn’t matter. It runs faster than people can think on almost any device. Software developers have always the latest devices, so it’s always fast enough for them. And that’s one of the reasons why it’s so slow with the slower devices, because the people that code then don’t really try to use the old devices, and so forth.
So, we create, we are part of the problem. That’s one of the things that, in software development, people don’t think that we are part of the problem, that we are part of the solution, because we have so big handprint as an industry that we reduce the emissions of the analogical industries with digital. But then we create a lot of digital emissions– I call them digital emissions, but we create emissions because of digital infrastructure. And a lot of those emissions would be avoided with better planning and better coding.
Tim Butara: That was a very good add-on, yeah. And another thing I’m interested about is cloud computing and how that can help with green or sustainable coding. And especially, I’m wondering if there are any misconceptions here that we should be aware, that we can take this opportunity to debunk and explain here?
Janne Kalliola: Yeah. I would say that the cloud is better than having the hosting on prem, because there’s so much code happening in cloud, there’s so much processing happening and there’s so much data, they can actually optimize and pack the computers as full as possible.
So the best utilization for a device is that it runs on optimal speed all the time, that there’s always something. If the system waits, of course it doesn’t use that much electricity. But if we have, let’s say, a thousand computers in some hosting center that are used approximately 60% power, and you can’t really change the, because all of those 60% are used by monolithic software.
But in cloud, with hypervisors, the software is less, it is smaller and granular, they are smaller pieces that you can then load balance. So, instead of a thousand computers, you could get away with 700 computers and still have some buffer in each of the computers and do the exact same computations but with less hardware used.
The caveat with cloud computing is that there is no capital expenses shown to the, that you don’t need to buy anything, any hardware, I need to buy a new server. But the amount of computing power, the amount of data that can be processed is infinite, sort of. And then it’s very easy to buy more capacity, and that has been made very very easy to buy capacity, and a little bit harder to get rid of the capacity.
And typically, from the software developers’ point of view, somebody else pays the bills of the cloud. So the invoice or the credit card belongs to somebody else. So they might never see the cost of the operations, and then when the cost is somebody else’s problem, then it means that the efficiency is also somebody else’s problem. And when the code is not efficient, it creates more emissions by both using more hardware and using more electricity.
And there’s probably people listening to this are thinking, but they run on green electricity, or they are renewable. But still the amount of electricity used in the world is growing so fast that there are still non-renewable power plants built; it means that somebody else is using that non-green energy. Especially in Europe, when it’s a windy day, there is a lot of energy available and it’s very very clean. But when there’s less of that energy available, then the energy is not clean.
And if we add more energy consumption by bad software then we will and use the green energy to run the software, then somebody else somewhere else is using the unclean energy like coal energy or gas energy. And somebody’s still using the energy, somebody’s causing the emissions, even if it’s not the IT. So we are fooling ourselves to think that it’s not our problem. It’s exactly our problem. The energy consumption of the IT is more than the airplane industry. And they are guilty of all the mishaps of climate change. They are the culprit of everything, scapegoat in a sense. But we are using as much energy as they are. Of course in different form, but it’s still energy that causes emissions.
Tim Butara: I guess this is the right place to ask, what kind of impact do you think that green coding will have on this whole digitalization, digital transformation movement that we’re witnessing right now in full swing?
Janne Kalliola: That is a very good question. This is typically a prelude to saying that I don’t have an answer. We are still quite early on that phase. I don’t know, probably no one really knows the impact of green coding. If the software is really bad, and I’ve discussed, this is anecdotal information, but still has some truth.
I’ve discussed with a cloud service provider, let’s say that the worst 5% of the software uses 80% of the energy. It’s just that the bad behaving software eats a lot of energy. Of course this is now in the field of content management systems and web applications, it’s not that kind of hard calculations. That if you have like AI or you are doing weather modeling or something that is complex, then you typically don’t have bad software, because the bad software will not get things done at all. So, it’s limited, this code.
But for example, the cryptocurrencies, their ability, they eat the energy of Argentina or eat the energy of Czech Republic. And that’s a lot, if you have cryptocurrency, that is on the nation level of energy consumption. That is like 20th biggest consumer of energy. Or the ad networks. There was a study in Finland made that the ad networks, meaning the ads that we see in Google and the websites, that they eat 10% of the energy consumption of the internet.
Because every single time there’s one ad shown, there’s 100 to 200 computers participating in auction that happens in milliseconds who gets the spot. And then you fire that every single time or five times, ten times when you go to a web page. And probably you and I, we go on hundreds of web pages every single day, because we are searching for information and whatnot. And then we multiply that with the amount of people living in first world, with a good access to the internet, let’s say 1 billion people.
There’s billions or trillions of ad auctions happening every day, and the value that they add to everybody else except that who runs the auction, that they get the best money out of it, is probably really really small. And these kind of things blows my mind, that there is so huge waste of energy on the internet, because it’s so cheap to run those things. And there’s a business incentive built on those. But the impact on the quality of life is very small. As an industry, we should really get our things together and start making changes.
Tim Butara: And in a lot of cases– the impact of ads, in a lot of cases, is not just small, but it’s nonexistent to the individual. Or, even, if we’re talking about emissions and energy consumptions and stuff like that, I can’t tie advertising and ads off from this over and hyper production. They go hand in hand, right? So, the more ads you have, the more production you have, and the bigger your energy consumption will be, because the ads will make certain things more attractive and more desirable, which otherwise wouldn’t even be needed, maybe.
Janne Kalliola: Yeah, that’s true. And the ratio that– I’ve seen ads on the internet like 20 years. Back in ‘98, 25 years ago, we made our first banner ads to fund a study trip to California from Finland. So I’ve been working with the web bubble for quite a long time, I’ve seen the ads. Then it was just an image file on the web page and no fancy stuff, no auction or whatnot.
But the times that I’ve, in 25 years, I’ve clicked an ad – not an accident, but just click an ad – is like once a year, twice a year. So, maybe 50 times, let’s say 50. And I purchased a product, there have been some good ads, but probably five products in 25 years. Maybe I’ve made decisions in the store after seeing something on the web or whatnot, maybe not, I can’t really say, I have not followed that. But those things that then I’ve actually purchased something followed by an ad, it has been really small.
I might be allotted in the sense that I don’t really want to buy stuff from the internet, or then I’m not an exception, I can’t say, I haven’t studied that much. But for me, it feels so complete waste of everything. The products, of course, I failed that I actually have a need that the products have fulfilled. And yes, it might have been better that instead of that I have traveled around the city of Helsinki to look for the product that I’m looking that I actually bought from the internet, or then not.
Tim Butara: I feel like most ads are not made for people who discuss the negative impacts of ads on podcasts.
Janne Kalliola: Yeah, that’s true also. And then, was it the same study or the following study, it was made by the University of Technology, was it 40% of the ads are clicked by people or machines that do that because they want to earn money for the people that host the ads. So there are click farms in China and so forth.
It’s just layer after layer after layer, the game just becomes more and more bizarre. It’s like reading a Kafka book or something like that that at every turn, no, this won’t happen, this doesn’t make any sense. It’s a surreal thing. And then there are huge companies, like Facebook and Google, or Meta and Alphabet, that get then almost all of the money from that system that is completely gamed and waste of many many things.
Tim Butara: So, if business leaders were to make any cuts, one of the first things they could look at to reduce their emissions and to be more sustainable, be greener also in the digital sphere, would be to have more streamlined advertising, maybe somewhere in that area. What are some other things that they should consider first before any other cuts or any other changes? What are the easiest changes to make?
Janne Kalliola: There are two kind of companies in the world in this sense. There are the companies that code, either for themselves or for somebody else. And then there are the companies that buy readymade code from somebody. So if you are on the latter end, there’s the golden rule that who has the code makes the rules.
So if you are buying stuff, then you should insist in the procurement that you want to have carbon-wise, eco-friendly, efficient code and have some kind of measurements, maybe get somebody to help with making your own procurement criteria and figuring out how to follow those. But if nobody demands change, change won’t happen.
If you are then on the other side of the fence, that you are either writing code for your own organization that you have IT department with software developers, or you are, like Exove is, a consultant company, we code for money. So then it’s about the awareness first, that people know that these things actually matter. Then there is the training, that what can be done.
There are certain ways that you can have an impact in a sense with your coding. And then they need to spread the word, also, to evangelize, what I’m doing right now. Hopefully, some of the podcast listeners will see the light after this one and see that, yes, this is the church of green code, this is where I want to belong. So that is important too because we need to have a change.
The actual what to do is, the answer is what the typical senior would answer to any junior question, that it depends. So it depends on the circumstances, it depends on the kind of the system you are working on and whatnot. It might be that if you are working for example image recognition, that kind of artificial vision, or you are working with the crypto contracts, or you are working with AI, or you are working with WordPress or Drupal, all have different implications and they have the hotspots.
I’ve seen three generic ways to do it. The first is the typical engineer way, that you measure and based on the measurements you will figure out what to change. The problem is that it’s extremely hard to measure things in a way that it actually makes sense. That you have information about the measurement and not just data.
So, if you can measure, very good, use that measurement and then find where the energy is used and where the time is spent. Because there was a study made by a Portuguese university that there is a very strong correlation between the execution time of software and the energy consumption in all languages that they tried out, with about 20 different languages. So, if your software runs faster, it will create less emissions.
So, that’s the first, you measure and then you make changes. And then you measure again and see, okay, this was done, and we got some change, and then you measure (inaudible). Typically, software is so complicated that you can’t get reliable measurements.
So, the next that I propose in the book, is reduce waste. So the concept of waste is like in the lean, the things that do not add value. So if there is some system in your software that doesn’t add value, cut it. If there’s a software that doesn’t add value, (inaudible). For example, a system that is monitoring something that doesn’t exist anymore. And sending alerts every five second, this is broken, this is broken, nobody cares about it; shut it down. There might be over complex data structures, that architects might be wrong. I recognize 10 to 15 types of waste, and all of them have different ways to mitigate the issues.
And then third way, after the measurements and the waste, is memoization. That you do a software that excels in the things, in the features that it needs to excel, and nothing else. Just get rid of everything. Because, if you have that kind of elegant system that is perfect for a certain use, don’t add bells and whistles. Because the software industry is also very (inaudible). But just stay true to the purpose and keep it simple.
A good example, I like to chop wood. My kids don’t really like it because they need to be part of it also, it’s good exercise. They will understand when they are 40 or something like that, I’m a firm believer in that. But I have a really good Fiskars axe that is a simplification of the axe for like a hundred years of continuous improvement. It’s extremely good at chopping wood. But it’s not good at, for example, if I would like to build a log house, then I would need to use a different axe.
So there is not axe that fits all the purpose and have different blades and whatnot, because it would be heavier. But there’s a simple tool for simple thing, chopping the wood. And that axe is sort of current perfection of how to chop the wood with axe. And I use it for that purpose only and then I have some other tools.
So in software world, if there would be a need that I need to chop just wood, and then I have a software that is a digital axe, that would be fine. But typically in software, there would be different blades, and the measurements in the axe and whatnot, because why not? It’s cheap to do, and what is interesting about those, that how fast you chop, what is the angle you chop and whatnot. And most of that doesn’t really matter, but it would just consume energy.
So, back to basics. The crucial things only. Because typically those software that do something well, simple things well, they are also the software that people love. That you will have the people that follow the software and might use it for years to come, because they like the elegance and the simplicity of it.
Of course you can’t have simple and elegant, let’s say, e-bank. Because there is so many different things that people want to use e-bank, somebody just wants to pay bills, somebody goes to handle loans and stock exchange and whatnot. So it goes on and on. But it might be that there are certain issues that you can use minimized software. So, three things, measurement, waste and memoization.
Tim Butara: That was a really great answer, Janne, and a lot of really great tips for listeners right here at the end. If these listeners would like to reach out to you, learn more about you, maybe check out your book, where can they do all that?
Janne Kalliola: The book is available free of charge at exove.com. It’s available in Finnish. If you don’t know Finnish, this is also a good guidebook to learn the language, Finnish is a great language. But for the language restricted people out there, the English version is also available and it’s a word-to-word translation, so it has all the same things. Please download it, because it’s crucial that we make a change. And I made a conscious decision that I don’t want to have the book published by somebody and get the money out of it, because I want to share the knowledge about these things.
Tim Butara: Awesome. We’ll make sure to link to Exove’s website, and hopefully a lot of listeners right now will also check out the book. Janne, thanks again for joining us today, it was great to have you.
Janne Kalliola: No worries. It was great to be here.
Tim Butara: And to our listeners, that’s all for this episode. Have a great day everyone and stay safe.
Thanks for tuning in. If you'd like to check out our other episodes, you can find all of them at agiledrop.com/podcast as well as on all the most popular podcasting platforms. Make sure to subscribe so you don't miss any new episodes and don't forget to share the podcast with your friends and colleagues.