r/programming • • May 08 '15

Five programming problems every Software Engineer should be able to solve in less than 1 hour

https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour
2.5k Upvotes

2.1k comments sorted by

View all comments

Show parent comments

2

u/ardalis May 08 '15

"Premature optimization is the root of all evil." - http://en.wikiquote.org/wiki/Donald_Knuth

1

u/Otis_Inf May 08 '15

but when is it premature if you know up front it's not? The thing I'm after is that if you know a better algorithm exists, why not implement that? The cost of fixing a slow system later on if the algorithm turned out to be slow (and we're talking in my example O(1) vs O(xn)) can be massive. I agree premature optimization in general should be avoided but it's not as simple as it looks.