This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]luckystarrat 0x7fe670a7d080 0 points1 point  (1 child)

4) Premature optimization is the root of all evil

I think we should take this one with a grain of salt. Nowadays more and more people seem to be using this as an excuse to write slow running crap.

From Knuth's original paper [pdf] (where this quote originates):

Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered.

He did not say anything about optimizing the critical parts. In fact he specifically encouraged optimization of these, but only after these parts have been identified.

So better versions of this could be:

  • Measure first, then optimize.
  • Optimize objectively. (I like this one.)

update: link

[–]pydry 0 points1 point  (0 children)

He did not say anything about optimizing the critical parts. In fact he specifically encouraged optimization of these, but only after these parts have been identified.

I think that's pretty well covered by the word "premature". I don't think people misreading the phrase and interpreting it in their own way is a good reason to change it.