In the first paragraph he notes that the quote was popularized by Knuth but 
cites Hoare as the author.

"Every programmer with a few years' experience or education has heard the
phrase 'premature optimization is the root of all evil.' This famous quote
by Sir Tony Hoare (popularized by Donald Knuth) has become a best practice
among software engineers."

As for the apparent contradiction between Hyde and Knuth I think that the
complete quote makes it clear that if the code is obviously awful then it is
wise to clean it up. That's different from simply making some wild
speculative guesses about were a bottleneck would likely occur.  Here is the
whole paragraph:

"Observation #5: Software engineers have been led to believe that they are
incapable of predicting where their applications spend most of their
execution time. Therefore, they don't bother improving performance of
sections of code that are obviously bad because they have no proof that the
bad section of code will hurt overall program performance."

This idea is further developed in the following paragraph:

"One thing nice about optimization is that if you optimize a section of code
that doesn't need it, you've not done much damage to the application. Other
than possible maintenance issues, all you've really lost is some time
optimizing code that doesn't need it. Though it might seem that you've lost
some valuable time unnecessarily optimizing code, don't forget that you have
gained valuable experience so your are less likely to make that same mistake
in a future project."

I'm not trying to defend the article just clarifying what I see as the
authors main point.  That being that we have a lot of clunky applications on
the market that seem to be poorly optimized.  I'll refrain from naming some
of my favorite clunky apps to avoid a tangential thread.

~joe






-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Charles
Yeomans
Sent: Tuesday, August 01, 2006 9:49 AM
To: REALbasic NUG
Subject: Re: SOT: Premature Optimization


On Aug 1, 2006, at 9:45 AM, Joseph wrote:

> This was just too good not to share.  (Slightly Off Topic)
>
> http://www.acm.org/ubiquity/views/v7i24_fallacy.html
>

While this article is not without some worth, I wouldn't trust it too  
far.  Hyde appears to be yet another of those who quotes sources he  
has not read.  The quotes about premature optimization he attributes  
to Hoare are actually those of Knuth, from his paper "Structured  
Programming with go to Statements".

I was also struck by his

Observation #5: Software engineers have been led to believe that they  
are incapable of predicting where their applications spend most of  
their execution time.

Perhaps they have been led to believe this by Knuth, who writes

"It is often a mistake to make a priori judgments about what parts of  
a program are really critical, since the universal experience of  
programmers who have been using measurement tools has been that their  
guesses fail."


Knuth's article can be found on the web, and I suggest that anyone  
wanting to learn about optimization and program design read it.

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to