People from different parts of the world support the environment in different ways. How as a Programmer can we be eco-friendly or being a green-programmer?

Hope if we can follow the best answers we can support the environment.

42 accepted

Advice specific to programmers:

  • Do everything digitally instead of with hard copies. Download ebooks, don't print anything unless you have to, take notes on computer instead of paper
  • Make sure your servers are hosted in a green data center
  • Telecommute
  • Shut everything down when you leave (or hibernate it)
  • Write more efficient code so your servers do less work. Throw more hardware at the problem only as a last resort.

General advice for office workers:

  • Live close to work
  • Drive a fuel-efficient car or take public transport
  • If you're only going a few miles, walk or ride a bike instead of driving
  • Try to buy local and/or sustainably-farmed food.
  • Bring lunch to work more often instead of eating out. When you eat out, you are driving to go eat food that may not have been farmed locally or sustainably.
  • Eat less meat and more vegetables. The higher up the food chain you go, the more energy is wasted.
  • Sleep more, work less :-)

If your software is widely used, write decent code. Shaving 30 seconds off that image stabilization code saves 30 secs of computer time, every time it is executed (30 secs * 10000 execs/day * 30 days = 104 days of saved computing time). That's far more energy than you'll ever save personally.


Turn off the light switch in your coworker's office after they leave to go on vacation. :)

Have unused boxes turned off or go into 'hibernate' mode for low power.


Recycling your old PCs and parts is a major factor. There's more gold in land fill sites from old parts than some gold mines apparently which some companies are trying to exploit through mining land fills!

Also don't leave your PC on at night like most companies do. This accounts for 2% of America's electricity usage per year - locked PCs in offices.


Turn your computer off when you're not using it.


All programmers should know The Rules of the Optimization Club, Amdahl's law, and Knuth's quote on optimization:

We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.

We can apply these laws to reducing anthropogenic greenhouse gas emission. For example, if 90% of the CO2/Methane/NOX emission comes from factor X, there's almost no point in optimizing factor A, B, C, or D. Just like the bottleneck in software performance. It certainly feels good to contribute to good cause, but making any significant change requires running profiler first.

I am not an expert on environmental science, but I guess w:Greenhouse Gas could be a starter.

alt text

From the above graph, I'd think Power stations, Transportation fuels, and Agricultural byproducts are the easiest to tackle.

  • Tell your local statesmen and power company to switch to greener energy.
  • Buy organic products that doesn't use fertilizer, produced locally if possible.
  • Cut down on beef and dairy consumption (cow burp contains Methane much potent compared to CO2).
  • Use mass transportation. If not drive car with high mpg.

Ultimately, it's too complicated to decipher where carbons are spent on our own. Even orange juice has carbon footprint. One solution may be to add the cost of carbon retrieval to the cost of product, in the form of carbon tax. By means of demand and supply, eventually everyone would go green.


Don't take showers. It's OK, because you're a programmer and people don't expect you to take showers anyway.

Note that you may sometimes get hosed down. Be sure to take a spare set of dry clothes to work.


The same things everyone else could do.

  • If possible ride a bike or walk to work (and everywhere else).
  • Otherwise use public transportation or car pool
  • When you have to drive a car, use one which is as "green" as possible.
  • When traveling far, try to travel by train and not by air.
  • Turn off ligts in empty rooms.
  • Make sure you turn off computers, stereos, tv sets, etc, when they are not in use. Don't just put them in stand by.
  • When buying food try to buy things that are as local as possible (That goes for most goods other than food as well I guess).

Code in a forest.

  1. Do not print on a paper until it is required.
  2. Try to complete all the tasks ahead of the schedule so that you don't have to do over time thus reducing the power consumption.
  3. Do not work on weekends

Design compact reports to save paper

If you write software that generates reports try to:

  • minimize the unused space on a page (use two columns, etc.)
  • remove superfluous information or graphics (fancy headings ...)
  • allow the user to select the wanted information (print only what you need)

This will reduce paper and toner (or ink) usage on the client side. If your client prints a lot of your softwares reports, this will save much more paper than you can by cutting down your printer usage.

  • Support nuclear power

Saving energy is fine, but nothing beats reducing the environmental cost of energy in the first place.


Buy an Aeron Chair. Not only because it's 94% recyclable; odds are you'll use it for a time span within which others would go through twenty (all destined for a local land fill).

Extra Bonus: they are nice and comfy.


Use VB.net it's better for the environment, Curley brackets have been shown to be bad for the environment


If you commute by car, work from home a couple of days a week if possible. You'll reduce your carbon output, and save a bit of money, too. I save ~24 (~$34) a week (1,248!) on diesel by working from home two days a week; that doesn't include car maintenance costs either. It's not insignificant. Plus, less traffic on the roads means less congestion which means free flowing traffic and thus much more efficient motoring for those who are on the roads.


Something that I have become very interested in is measuring power consumption per transaction. For instance when a user searches on our site how many watts does it take to answer their question. How many watts does it take to turn a visitor into a customer. This type of analysis will lead to some suprising optimizations.

James Hamilton has written about power consumption of scale services extensively and is now measuring with 2 metrics, work done per dollar and work done per joule.

I would say to Nolte that while there can be valid reasons to colo in metropolitan data center any reasonably large deployment can only be cost effective in a remote datacenter since power is now the largest cost in running large services. As it turns out the larger the deployment that you have the more sense this makes.

I think in the future the only way to make an application scale cost effectively will be to use Azure, EC2, Google App Engine, another commercial alternative, or an in house developed alternative. The cost differential that those services get as opposed to more traditional models is staggering. For instance if you have a fabric of fail in place servers maitenance costs will be much lower than sevicing servers as they go down.

Interestingly here business needs (lower power usage) coincide nicely with environmentalist wants (lower power usage).

James Hamilton's Site


I think you're fooling yourself if you think you can be green. Sure you might be able to be a little greener but I doubt this will override your non-green credentials much.

As programmers we make computers cooler and make people want to use them more, by definition this consumes more electricity and requires more energy. If you truly want to be green I'd suggest becoming a Luddite.


I'm becoming more obsessed with the amount of electricity I use, I've got a electricity meter that lets me know how much juice my development rig is sucking.

  • Use a Laptop -- they generally are lower power, and you improve your mobility.
  • Get an Energy meter like Diy Kyoto visualise how much your PC's costing
  • LED Monitors - use less power
  • Virtualize - it's all the rage, but 1 beefy new box, will be better than 4 old machines
  • Turn your stuff off, when you're done with it.
  • Upgrade to Solid State drives (you were looking for an excuse)
  • Work from home - if you can
  • Live within a reasonable distance of work if possible
  • Use virtualization for your server needs - this way you can reduce electricity consumption. Instead of using 12 servers at my work we have a single machine with Hyper-V.
  • Don't use plastic cups for your drinks (coffee & coke) instead bring a mug from home.

Make sure your company's datacenter/hosting is powered by "green" power sources. You can do a lot by moving your co-location into regions with hydro-electric power, wind, solar, etc... It's also a lot cheaper, compared to coal. Of course, having to fly to such a location to service the machines would likely cancel out any environmentally friendly efforts you are making.


Some advices that I think could help:

  • Use a LCD display instead of a CRT.
  • Use a laptop instead of a desktop.
  • Avoid using public coffee machines as they produce a lot of waste (plastic cups are used once and then trashed). Keep a coffeemaker instead and use your own cup.
  • Recycle your waste, put plastic with plastic and paper with paper.
  • Avoid using a lot of electric light while you could go with an abat-jour.

Assuming that this has to do with the role of a programmer and not that of a manager here?s my two cents.

  • Optimize your code where it?s run the longest and most frequently. Saving 45 MS by not reading the DB is valuable time when run frequently.
  • Employ caching because solid state is more efficient than reading a disk.
  • If you have long running reports then try to alter other functions to perhaps do some of the work before the time comes to run the report. So if you have to some lots of data in a report increment the numbers when you work with the data first. Then just read that number.
  • Use the power saving features that are built into your computer so that when you leave for a coffee the screen is off (screen savers are not eco-friendly).
  • Re-use old equipment where possible instead of throwing it out.
  • If you have to throw it out then take it to a company that recycles computers. The heavy metals in them are really damaging to the environment so this might have a huge impact.
  • Use speed step technology so that your processor is only drawing the power that it needs.
  • If you work at home then consider moving to the basement where it?s cooler in the summer thus cutting down on air conditioning costs.
  • If working at home then you can install solar panels on your home.
  • Consider alternate cooling options for your servers. A cooler server will draw less power.
  • Don?t order out, cook at home (this might be hard for some)
  • Lastly, get a white board if you don?t have one (and you should) it saves a lot of paper.

Some of the ways I follow:

  • Using e-books, kindle.

  • Switch off the monitor when not in use, switch off the system everyday.

  • Share the books that I have.

  • Only print if you need to. And separate it in the trash.
  • Don't turn the heating on, and then open the windows because it gets too warm.
  • Shut down the air conditioning when you go home.
  • Activate the eco-functions of your computer, make it turn off the screen after a few minutes and go in stand by after a few more. Don't use a graphic screensaver, only an empty screen.
  • Use a whiteboard to instead of a flip-over.
  • If you don't use your computer, unplug it. Even when computers and printers are turned off they keep consuming energy.
  • If you have to print out something (for yourself, not for e.g. customers), consider printing it on the blank backsides of already used paper sheets.
  • Think before turning on that air condition - I found that very often people just use the air condition when they could as well just open the window (which also gives you the beneifit of fresh air ;-). When it's warm, dress lightly, when it's cold dress warmly (yes, this sounds obvious, but I've often seen people working in thick woolen sweaters at the height of summer because of the air con).
  • Use video conferencing instead of flying/driving to the location.

Use a lower power PSU and GPU (Or just use a laptop). You don't need a Nvidia Geforce 9800 beasty with extra cooling to write those ASP webforms....

Unless of course, you're actually writing something that does require that power....


Always create branches, and never tamper with the trunk ;)


Here are some basic things I do:

  1. Ride to work
  2. Recycle
  3. Buy energy efficient desktops and servers
  4. reuse cups, plates, and silverware from the kitchenette
  5. Print using both sides of the paper, and only print when needed
  6. Telecommute at least one day a week
  7. Ride the bus when I can't ride my bike
  8. Carpool with a buddy
  9. Cancel all those stupid free magazines they send you
  10. Replace your lights with CFLs
  11. Take a staycation a few times a year

Don't ever code for spammers. Spam wastes enormous amounts of energy..literally.

  • Don't upgrade your computer until you really need to. When you finally do, recycle your old computer, sell it, donate it, or give it to an organization that disposes of computers responsibly. There are lots of hazardous materials inside your machine that are not eco-friendly.
  • Get books out of the library or from trading websites like craigslist or PaperBackSwap. If you buy new, it uses more trees.
  • Not working with a particular technology anymore? Then consider offering your books about that tech for trading.

stop downloading emules/torrents at night and just turn it off


My points would be:

  • Stop using paper for temporary algorithm/architecture/system design drawings, instead use notepad, or some free application like dia.
  • Read as much articles on-line, not on paper, but this can harm your eyes a bit.
  • Stop making paper planes :)
  • optimize usage of toilet paper, use it from both sides. (This suppose to be a joke ^^).
  • Eat healthy food, do not order pizza's and similar stuff which came in paper bag.
  • Do not download music, support artist.
  • Do not download movies, instead go socialize, go to the cinema, but ticket is make from paper (doh..)
  • Go to the gym, then you'll have more energy to work, and your body will look better.
  • Use Open Source more. Support O.S. developers.

I thinks I'm out of ideas now, but You can think of more them.


Recycle your friggin' coke cans.


Don't print everything. I see a lot of fellow developers print the source code to take a "closer" look or something. Try to use the electronic copy as much as possible.

Printing is like killing Oxygen.

  • Buy a indoor plant
  • Walk to work

Over and above all the good things we as individuals can do, software developers can make a huge impact just by how they architect systems. Instead of throwing more machines at a problem, it can make both economic and environmental sense to make performance and scalability improvements that dramatically reduce your hardware needs:

  • Use a virtualization technology like Xen to run more than one virtual machine image on each physical host.
  • Counter-intuitively, it sometimes makes enormous sense to replace old, large, slow, power-hungry 2U servers with new, fast, power-saving 1U and blade servers.
  • Run your virtual machine images on a cloud like Amazon EC2 to avoid setting up your own data center.
  • Learn from the masters at highscalability.com and do things like replace 10 application servers with 2-3 fast memcached (in-memory cache) machines.
  • When you write a web application, set expiration times to enable more caching, do gzip compression, minify your Javascript, etc. to save web servers. Yahoo's YSlow! tool is great for identifying front end optimizations.
  • If you have programs that burn up a lot of CPU hours, run a profiler and see if you can find any low-hanging fruit. I once spent a month doubling the performance of one program and saved Lucent several million dollars (they were so grateful, they even gave me a bronze cost-reduction pin!)

Use real science and real math to determine what saves energy and is environmentally friendly.


1) Don't promote the concept of Global Warming which has already been proved falacious (see NASA AQUA Satellite Data). Even the big promoters of Global Warming have switched to Climate Change as the term, since the data won't support them.

2) Based on the First law of Thermodynamics, the energy you bring into a closed space (home, office, etc) will be the same whether a fridge or a heater. So it's an illusion that removing an old fridge will save you any electricity if you have any heaters in the space.

Another good link: http://www.accesstoenergy.com/


Don't breed.

Suppose the average human causes 1 unit of environmental damage.

You use a bike generator to power your laptop and eat only wild-foraged chickweed, and don't heat your home, and compost your poop. You are wildly successful, reducing your impact to 0.5 units of environmental damage.

Then you have a couple kids. If they meet the average, you're back at 2.5 units. All that effort is lost. And you're already 1/2-way through your life: they're just getting started.

(Maybe you'll teach them to follow in your footsteps, but just as likely they'll rebel and get a Hummer to drive to McDonald's.)

I'm not really here to tell you how to live, just to point out that how many new people you create is likely to have a bigger impact on the environment than the rest of your decisions put together.


Stop Googling:

Harvard physicist, Alex Wissner-Gross, says that performing two Google searches uses up as much energy and can generate about the same amount of carbon dioxide as boiling the kettle for a cup of tea.

A typical search generates about 7g of CO2 and boiling a kettle generates about 15g. It is estimated that more than 200 million searches are generated daily worldwide.

After you get that one nailed down, stop breathing.