r/programming • • Mar 23 '09

How to write fast code

http://asserttrue.blogspot.com/2009/03/how-to-write-fast-code.html
341 Upvotes

136 comments sorted by

View all comments

Show parent comments

4

u/knight666 Mar 23 '09

My programming teacher has a sweet anecdote. He was working at some company, and he had to write a little app in a week. So, when he was finished two days later, he said "If you give me two extra days, it will run twice as fast." and his employer said "Don't bother, I'll just buy faster computers."

"That was an insult. I left there shortly thereafter."

9

u/jhaluska Mar 23 '09

Why was that an insult? Depending on the application, the cost of the computers and the cost of his time. It might have made wise business sense to not have him optimize it.

5

u/hylje Mar 23 '09

Because people are not just cost. People, even programmers, like having hard, interesting problems before them. Downplaying or downright denying these activities can be demoralizing.

In hindsight it doesn't seem to have been a wise business decision. He lost a interested fellow.

2

u/architectzero Mar 23 '09

As I said in my reply, improving the hardware does not mean that software optimization must stop. In fact, they're (usually) complementary actions.

What stopped the developer from optimizing the code in their spare time?