VueScan? Just works.
I have no stake in this. I am just a happy customer.
Peter Gabriel just called from Scotland. He says it's the Fifth of Force.
Can I see you in my office please?
I'd put that in its own function, and write it:
case 1: return 4;
case 2: return 5;
1) Only one statement per line,
2) The function can be named to make the code more readable in lieu of a comment explaining the switch..
It was a bit loopy.
I do that fairly often, but like:
case 1: return blah;
case 2: return blah * 2;
default: throw up;
Putting two statements on one line really is a bad idea.
Yeah, I think that's the point. We've managed to take something meant for web pages and figured out how to embed fucking operating systems into it.
Maybe the underlying libraries now catch these things, but back in the day it didn't. Even with Java, writing platform independent code does require some care.
For corporations this changes any way: 5 year old gear is amortized and should be replaced, just because the beancounters say so.
However, I doubt you can totally offset the energy savings by purchasing new gear. Assume 500$ for a new machine (Business machines? Hell, you won't get them that cheap, but I'll run with it). I don't know how much my i7 rates, but I know it comes with a 90W powersupply. As such we can assume it uses that as a maximum. Assume a new i5 laptop will use half of that: 45W. So, you save 45W, which means you save 45*24*365 Wh = 394.2kWh over year. Let's assume you live in New York, which means you pay 18.1 cents per kWh (okay, values are from late 2011), which means you pay about 71$ less per year by the replacement. Assuming the 500$ investment, you need 7 years to break even. This is true regardless of scale (1 computer or 10000 computers)
So, yes, energy is a factor, but if it were the only factor, it wouldn't be cost effective. Do, also note that in every assumption I was very very friendly with the "replace" argument: cheap replacement cost, expensive electricity....
Of course, I might have miscalculated and you're right... who knows....
See also: planned obsolescence.
"When people are least sure, they are often most dogmatic." -- John Kenneth Galbraith