Thursday, June 13, 2013

"Green" Programming

Today I saw an article by The Onion (of all sources) parodying our horrendous environmental impact with our species' production culture.

Find that here: Advanced Alien Civilization Discovers Uninhabitable Planet.

It reminded me of all of the paper that BASHCon wastes with its print ads, postcards, and lengthy program guides. But, more to the point of this post, it reminded me of the concept (that I think I invented?) of "Green" Programming.

Green Programming is the concept of removing code that is no longer used so that computers that read the code don't expend the electricity resources to load it. Even though you may have a chunk of code commented out, if you find out at the end of the project that you really don't need it, get rid of it.

If you're on the fence about permanently deleting it, you could save it to a hard disk. That doesn't expend any more energy than what it takes to actually write it, and then only the development team (tiny compared to the user base) would need to access it.

Think about it: if you have a program that has lines upon lines of unnecessary, unused, commented-out code, and you release that program, then every machine running the program will read that useless code. And then, let's say it's a popular program like GIMP or Firefox, and now you have millions of computers using electricity to read useless code.

Sure, on the small scale, it's insignificant, but when all of the millions are doing it, it makes a sizable impact.

Long story short: get rid of code you don't use; don't just comment it out. It really saves electricity.

No comments:

Post a Comment