Keep your code clean to make it green

I think the unwritten law of blogging states that if you hadn’t particularly been thinking about a topic and you get one phone call and three e-mails from different sources focused on the same issue – then you have to blog.Yesterday, my contribution to the green ecosystem extended to recycling a few beer bottles and shredding some paper for recycling.

I think the unwritten law of blogging states that if you hadn’t particularly been thinking about a topic and you get one phone call and three e-mails from different sources focused on the same issue – then you have to blog.

Yesterday, my contribution to the green ecosystem extended to recycling a few beer bottles and shredding some paper for recycling. But then, I received a handful of calls, mails and tweets questioning the green coding concept.

Essentially, I am asking: should developers care about efficiency in code creation from a processing time (and therefore energy consumption perspective) on top of their normal considerations i.e. just building a great app.

Of those that contacted me, one source was interested in looking into whether there is scope to lobby the Brussels ‘Euro-crats’ at the EU to champion the cause of energy efficiency through better software development for mobile Internet devices from smartphones & netbooks. I think the jury is still out on which OS we should be using on our Acer Aspire or Asus Eee – and with open source already doing such a good job for these machines, I don’t see much point in mounting a campaign for cleaner corporate coding in this space.

I asked Tom Raftery, lead analyst, energy and sustainability practice at RedMonk about this subject as he runs a sister site called GreenMonk. Tom pointed me to a positive thought on this subject that suggests that efficient programming is inherently energy efficient.

“Ask a developer what ‘good code’ is and they will very often say that it’s the maximum functionality in the smallest file footprint, smallest RAM requirement and least CPU utilisation – and that is essentially green (or efficient) software.”

Tom’s RedMonk colleague James Governer added, "Tight code is green code. Of course we wouldn't recommend that everyone go back to first-principle coding basics - but clearly thinking about memory and process utilisation up front, and perhaps using environments that are built to take advantage of concurrent low power muliti-core processors is a really good idea."

As I said, I received a bunch of comments on this subject from different sources. Also peppering my inbox was a note from a company called Verdiem who is shouting about a tool called Edison (cute), a “free” energy monitoring application that allows eco-conscious consumers to actively control their PC’s energy consumption. Verdiem, it says here, helps Brits save money on their energy bills and fight climate change by reducing carbon dioxide emissions from homes across the UK.

Apparently you can download this thing for free, but I’ve been trying to get on their web site all morning and it’s a case of “HTTP Error 503. The service is unavailable.” So that’s pretty efficient! You can download it from CNET here though. But it is Windows only so that’s a bit of a poor show anyway isn’t it?

Now correct me if I’m wrong, but humming banks of processors tends to make your average techie feel warm and happy. Getting some of these green coding messages might be harder than some people think. Right, must go and hire that Hummer for my trip to Vegas next week.