Eco-Coding

This is a compilation of a few thoughts and ideas that I had the other night. I feel somewhat powerless taking on the climate change threat and I do what I can as a human being. The most destructive powers on the world from my point of view in some order would be like:

  1. Having kids - Accumulative resource consumption, potentially exponential.
  2. Eating meat - Cow's are beautiful but they are inefficient food-based energy sources and consume a huge amount of energy, outputting just a tiny amount as energy for my body.
  3. Consuming stuff - Just a bout any consumer product produce a shit-load of waste from both production and packaging.
  4. Driving my petrol car - We have been quite conveniently nursed in to the freedom of cars. And most our infrastructure is making it very hard to break this pattern.
  5. Traveling by plane - I personally don't do it very much anymore but still I feel extremely bad when I have to.

... But... Then I came to realize - I'm probably making EVEN MORE harm to the planet just doing what I love to do and what I do best. Programming various things. How come?!? It's just code?! How can that be harmful?

Background

In a world where we are facing a huge change - Where climate change is a big deal... What responsibilities do we have as hackers, software engineers, coders, programmers or whatever we want to call ourselves.

We have an ever growing amount of computing power available, much of it is located "on the other side of the screen" in servers, and other infrastructures. As software people we also tend to take all our computing power for granted. Somewhere along the line of time we stopped caring, since random access memory and processors are freaking powerful these days. We also stopped caring how we store data, and where.

So what can we as software people do to make some kind of huge impact on things?

A general statement for all categories of jobs would be go like this:

Going to work every day doing what we've always done - The same way we've always done it is not gonna cut it, if we want to change the way we distribute our delicate planet's resources.

Some examples of bad behavior

Here follows a few examples on how we as software people have quite a lot more impact on things than we might think. "It's just code", right?

Without putting too much science behind them, here are a few statements:

And who are responsible for these behaviors - We... The software guys who invent these kinds of services on a daily basis.

Reflection on behavior

I have been working as a software developer for many years now and I am also a huge fan of agile methodologies where resources are not the bottle- neck in my creativity as a programmer. I rely on having fast feed-back from automated functionality checking and continuous integration. I even worked at a place where we had like 200 branches in our code repositories and most of these 200 branches automatically had created 200 at least four full-stack end-to-end jobs in our continuous integration machinery.

I came to think about how much computing power every single commit and push to the source code repository system actually involved.

The way we had the automation constructed was to wipe the local repository, clone a new one, and start building, running unit-tests and then building everything again for another integration level and scale up to a kind-of full-stack test suite. Just to feel safe that the code works.

During my time on this company I mainly focused on the weird behavior of having so much time wasted on just doing the same thing for about 900 jobs in the integration machinery. But I never even considered how much impact such process design probably have on the worlds climate.

If my bosses are business-men they probably want to have as much return on investment as possible for this kind of infrastructure and probably signed the cheapest deal they could find on electric power - Which usually means dirty ugly power generation from non-renewable sources. Because that's how companies usually function. Only thinking of what is of economical interest to them. Making a psychiatric analysis of a generic business as an "individual" would probably point out that the "individual" is a full blown and total psychopath.

A simple change to my product

This example might be taken to the extreme, where pointless waste is produced.

I push a commit containing a 2 byte change (i by mistake wrote a tiny spelling error in a text file or code comment for the release notes to the product).

Because our validation methodology trust the continuous integration machinery to run all the required jobs to make sure that the product is potentially deliverable - This is what happens.

  1. I push the code (text-file change) to the source repository server
  2. The monitoring of the repository sees my commit and triggers a number of jobs to be performed by the continues integration compute nodes.
  3. All nodes available are activated or tries to schedule the job run as soon as possible
  4. Local storage of my product is cleared, a new version is checked out and the build system kicks in to build binaries to run tests
  5. All code is built and unit-tests are run
  6. All code is built again and integration tests are run
  7. All code is built without debugging and system-level release checks are run
  8. Documentation is generated
  9. A mail is sent for every job to me, and my fellow 30 or so engineers that the jobs are now back to normal.
  10. I now feel safe to merge the branch with the master branch as some kind of release-sign-off.
  11. The monitoring of the repository sees my commit and triggers a number of jobs to be performed by the continues integration compute nodes.
  12. All nodes available are activated or tries to schedule the job run as soon as possible
  13. Local storage of my product is cleared, a new version is checked out and the build system kicks in to build binaries to run tests
  14. All code is built and unit-tests are run
  15. All code is built again and integration tests are run
  16. All code is built without debugging and system-level release checks are run
  17. Documentation is generated

... I relax, and feel I did something good. I fixed it, and my product is now working again.... But... Wait a second. All I did was to change a text-file. That has NOTHING to do with the unit-testing of the product and definitely NOTHING to do with the integration tests, maybe something new is performed in the release checks and documentation.

It does not take a rocket scientist to realize that most of the steps above are completely wasting both resources, time and did not even reduce the turn-around time for me to get a solid verdict.