How to be an Environmentally Aware Software Engineer with Green Code & more ♻️
Tags: discuss, watercooler, codequality, productivity
Published: 2021-08-17 19:21:14

## Table Of Contents
   * [Setting the Tone](#1)
   * [Writing Green Code](#2)
   * [Dispose your Old Tech Properly](#3)
   * [Small Changes](#4)
   * [Conclusion](#5)


Recently, while scrolling online, I was met with a video I haven't seen in quite a minute, and that clip was [The Story of Stuff](https://www.storyofstuff.org/movies/story-of-stuff/). If you never watched the animated short film, it gives an in-depth look at what happens to our... well, stuff! And after being reminded, yet again, of our failed civic duty as humans to take care of our planet, I decided it was time to talk about something a little more serious today: **being green.** 

*I want to preface this by saying that thinking about our impact on the world may feel overwhelming, to say the least. It can stir up feelings of worry, guilt, or even insecurity, and it is normal. If you do experience those feelings in any way, it means you care about what's happening. And despite what others may say, it's __not__ too late to take action.*

## Setting the Tone <a name="1"></a>

I want you to imagine you're a developer at a big tech company, *or maybe you even are*, and it's your first day heading into one of your new office spaces. 

Upon walking through the entrance, you see what can only be described as an indoor forest. With walls covered in green and thousands of plants, you inhale a breath of fresh humid air and look around at the green sea that surrounds you. After finding a suitable palm tree to work under, you set your bag down and venture off to the complimentary cafe to grab yourself a coffee, *in a recyclable, cardboard cup of course*. While your morning drink dispenses, you read the Century Gothic typeface mission statement posted above the coffee station about how all their beans are "sustainably sourced". 

I'm sure the last thing you're thinking is, "Wow, this company *isn't* environmentally friendly." How could you, when everything around you says otherwise? Well, maybe that's the point. 

As Developers, we often assume our jobs are "green".  Working with bits instead of paper, already makes us feel like we're doing our part. *I mean, could you imagine if every file you ever made, you wrote with a pen instead? That's a lot of trees!* But other than that, what else can make our jobs eco-friendly? 

## Writing Green Code <a name="2"></a>

Green code is not often spoken about, but I swear it's a thing! When you think about green code, the words DRY, efficient, and reusable may come to mind. And, you're right to think so! While all those things do make up green code, eco-friendly code can be so much more. Here are several ways you can simultaneously improve code performance and make it green:

+ **Factor in Environmental Costs**
   + There comes the argument that writing slow code and buying more servers costs a lot less than added development time. But, let's not forget the hidden costs produced by additional servers. The Datacenter electricity that a server uses in one year can be priced at or more than the server itself. Not to mention more expenses for racks, cooling, bandwidth, software, and the materials/manufacturing processes that go into assembling the server itself.

+ __Develop Eco-Friendly Apps__
  + As silly as it sounds, from now on when you're developing apps consider how you can make the product more eco-friendly. If you're creating an e-commerce website, what are some ways you can lessen the environmental impact on the product itself? Or when creating a website for entertainment, maybe you can allow users to directly download tickets, versus printing them. There are many creative ways developers can do their part while decreasing environmental costs. 
+ **Code in the moment, not the future**
   + It may be true that if you wait to run your code on a future device, it will run faster than it runs today. But using the fastest mechanism you can find as your acceptable performance benchmarking system is not being a green developer. Instead, try running your script on a machine from several years ago that has a slower CPU, less memory, and a smaller hard drive. Now, with code that has acceptable performance running on outdated machines, you've significantly reduced your contribution to the growing landfill of hardware.

+ **Be Memory Conscious**
   + Developers are fortunate enough to have easy access to large amounts of memory, and often forget that there are still many people using PCs with far less. While you may not think memory costs much, *if not anything*, what happens when need the machines that are barely capable of holding 1GB need to be replaced? And guess, where do those machines go?

+ **DRY...DRYer**
   + Writing DRY code is one of the first things we learn, *or should learn*, as programmers. DRY (Don't Repeat Yourself) code allows for decreased production time, cleaner code, and a clear head. But far too often, after a developer feels they have written DRY enough code, that scripts are left in the corner to collect dust for weeks, months, *even years*. So, while that code might be DRY for the moment being, developers need to revisit old code and clean it up as new technology is released. DRYing up your already DRY code can speed up the performance, and ultimately make you a greener coder.

## Dispose your Old Tech Properly <a name="3"></a>

Slightly contradictory to the previous section, there comes a time where you must upgrade your device. But it's how you toss out your old device that determines whether you're a green engineer or not. So, what are the ways that you, *and the people out there with their 2005 PC sitting on the curb*, can finally get rid of old devices?

+ **Donate**
  + Donating your device doesn't just help out the planet, but it also helps out someone in need. While you may no longer find the model of your touch screen phone sufficient, someone out there would be more than grateful to have one in the first place. [DellReconnect](https://www.goodwillsc.org/donate/computers) is a partnership with Goodwill that accepts any brand of computer, and “just about anything that can be connected to a computer”. So, drop off any of your used devices at participating Goodwill locations around the country. Another organization you can donate to is, [World Computer Exchange](https://worldcomputerexchange.org/get-involved/give-computers/). The WCE has a mission to diminish the digital divide in developing countries, promoting the reuse of and proper recycling of electronics, providing them to communities around the world.

+ **Recycle**
  + In some cases, a device might not even be sufficient enough to donate, but that doesn't mean it can't be recycled. The [Sustainable Electronics Recycling International](https://sustainableelectronics.org/) hosts a directory of  [facilities certified for electronic recycling](https://sustainableelectronics.org/find-an-r2-certified-facility/). You can also do some research and see if any local charities offer electronic recycling. One example is the organization, [Call2Recycle](https://www.call2recycle.org/locator/), which offers drop-off locations for recycling electronics all over the U.S.

+ **Refurbishing Programs**
  + A more popular way of reusing tech, is through refurbishing programs. You may be familiar with the method already, but large companies, such as Apple, allow you to bring in your old products and may even buy them back from you based on their condition. [Apple's giveback program](https://www.apple.com/shop/trade-in?afid=p238%7Cs00BQdc5f-dc_mtid_1870765e38482_pcrid_264960300465_&cid=aos-us-kwgo-brand--slid--product-) offers up to $1,530 in gift-cards or in-store credit for qualifying products. Other companies that offer similar giveback programs include: [Best Buy](https://www.bestbuy.com/site/services/recycling/pcmcat149900050025.c?id=pcmcat149900050025&DCMP=rdr0001422), [Office Depot](https://www.officedepot.com/cm/services/ink-and-toner-cartridge-recycling), [Staples](https://www.staples.com/sbd/cre/programs/rewards/learn-more/), and [Sprint](https://secure.sprintbuyback.com/bbt/).

*If you have any other eco-friendly methods for disposing of electronics, feel free to comment on them below!*

## Small Changes <a name="4"></a>

Although it might not seem like much, **the last thing you can do as a developer is make small changes that honestly have nothing to do with being a developer, but all to do with being a decent human.**
 

 + **Sustainable Shopping** 
   + I cannot stress this enough. While ordering a product online for overnight delivery is extremely convenient, __getting that package to you could have an environmental cost up to, *if not more*, than 15 tons of CO2 in the atmosphere. That's as much carbon as fifteen 40-year-old trees filter in one year.__ Let that sink in. Hopefully, next time you click the buy button online you consider, A.) Do I need this? and B.) Can I buy this locally?


 + **Switch out those plastic bags for reusable ones.** 
   + If you need a reminder of why you shouldn't use plastic bags check out [The Great Pacific Garbage Patch](https://theoceancleanup.com/great-pacific-garbage-patch/). Also, consider if you even need a bag such as when you're buying one or two items. 


 + **Turn off lights and unused electronics.** 
   + Anytime something is plugged in, it's using power. So that lamp that sits as decoration and rarely gets turned is probably better off unplugged. 


 + If you're working from home great! If not, **what are ways you can lessen the environmental impact on your daily commute?** 

These are just a few of the thousands of ways you can decrease your carbon footprint, if you're interested in even more ways, Columbia Climate School wrote a great [article](https://news.climate.columbia.edu/2018/12/27/35-ways-reduce-carbon-footprint/) covering how to do so. 

## Conclusion <a name="5"></a>

Being a green developer is still a choice, but let's hope one day it just becomes apart of who developers are. ❤️️


### Resources 
+ [The Story of Stuff](https://www.storyofstuff.org/movies/story-of-stuff/)
+ [Dell Reconnect](https://www.goodwillsc.org/donate/computers)
+ [Columbia Climate School](https://news.climate.columbia.edu/2018/12/27/35-ways-reduce-carbon-footprint/)
+ [The Great Pacific Garbage Patch](https://theoceancleanup.com/great-pacific-garbage-patch/)
+ [Sprint](https://secure.sprintbuyback.com/bbt/) 
+ [Best Buy](https://www.bestbuy.com/site/services/recycling/pcmcat149900050025.c?id=pcmcat149900050025&DCMP=rdr0001422)
+ [Office Depot](https://www.officedepot.com/cm/services/ink-and-toner-cartridge-recycling)
+ [Staples](https://www.staples.com/sbd/cre/programs/rewards/learn-more/), 
+ [Sustainable Electronics Recycling International](https://sustainableelectronics.org/)
+ [World Computer Exchange](https://worldcomputerexchange.org/get-involved/give-computers/)
+ [How to Recycle Old Electronics](https://www.consumerreports.org/recycling/how-to-recycle-electronics/)
+ [Rules for Being a Green Software Engineer](https://www.axosoft.com/dev-blog/rules-for-being-a-green-software-engineer)