2 ms·
I generally take the definition of "premature optimization" to be "going out of your way to improve performance". If you know a faster (better?) way, use it.
by jkmcf 18y ago
I generally take the definition of "premature optimization" to be "going out of your way to improve performance". If you know a faster (better?) way, use it. Sometimes, people seem to confuse YAGNI and premature optimization with just "knowing better".
For your grep example, unless you are using the output of grep for something else, there's no reason not to use the awk version except ignorance (which I'm plenty guilty of re: awk and sed...)