News for hackers. Stuff that matters.
Re:Is it morally wrong to write inefficient code? by bluGill on Wednesday November 04, 2020 @02:43PM (#24992359)
Even worse, most programs are not run very often. The CO2 you spend working on making it more efficient (all the test runs) is more than the total CO2 you save in many cases. Thus making your first working draft of code (working meaning bug free enough for your purposes) uses less CO2 over the lifetime of your code than you would spend working on making it faster

There are exceptions. There is a reason why people spend years staring at micro-benchmarks of sort to save one cycle: they can save tons of CO2 every years. However for most of us sort is just a function in our library and we shouldn't think about it. Your typical programmer thinking about sort will waste far more CO2 due to a worse algorithm than someone else already put into the standard library.

There are no comments on this comment yet.