Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Premature Optimization is the Root of All Evil (was Re: Ovidian Transform)

by hsmyers (Canon)
on Jan 01, 2002 at 09:47 UTC ( #135494=note: print w/replies, xml ) Need Help??

in reply to Premature Optimization is the Root of All Evil (was Re: Ovidian Transform)
in thread The Ovidian Transform

Well the snap answer is “Why not?” But more to the point why write code that is less efficient than need be? In fact, you can't even get away with the canonical 'lazy' as a reason, since what I wrote takes less typing. And the declaration of an un-needed variable doesn't do a whole lot for clarity—particularly in a routine which already has the potential for confusion, i.e. the two container arrays, where the second is used for the cross-wired transfer, something that might at casual glance seem a puzzle. So since it is clearer, faster, and shorter, I'd argue a win! Re: Mr. Wulf, nice quote, but in this context it somehow reminds me of
A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines. With consistency a great soul has simply nothing to do. – Ralph Waldo Emerson “Self Reliance”


"Never try to teach a pig to sing…unless of couse if it's New Year's Eve! Happy New Year to All!."
  • Comment on Re: Premature Optimization is the Root of All Evil (was Re: Ovidian Transform)

Replies are listed 'Best First'.
Re: Re: Premature Optimization is the Root of All Evil (was Re: Ovidian Transform)
by chip (Curate) on Jan 03, 2002 at 03:14 UTC
    I think you're arguing against a point I didn't make. (Though, in fairness, I might have been arguing against a point you didn't make.) I didn't suggest that optimization was unimportant or even undesirable; rather, that given a program almost entirely written in Perl, there's usually no point in speeding up the C bits. The key word is "usually", BTW; my main point is that optimization should only be attempted when profiling shows that the effort will be rewarded.

    UPDATE: The following complaints are wrong; please ignore them. I've left them here for hysterical raisins, and so replies don't seem confusing.

    BTW, you don't help your case when you use punctuation marks that are neither ASCII nor Latin-1; it makes your comments hard to read. Let me guess: You're using Windows, right? You ought to look at your comment from a Unix system; it has lots of question marks where they don't belong.

        -- Chip Salzenberg, Free-Floating Agent of Chaos

      You are right, I've no argument with things stated that way!

      Now on to the important stuff! Regards punctuation, I'm at a loss on this one, as other than ASCII, I've no way of entering the mystery marks into the message. Perhaps you may mean my overuse of HTML? Things like mdash, hellip, ldquo and rdquo with the occasional ndash are pretty much second nature to me. Note that here I've used them without the preceding ampersand and the trailing semi-colon. If these show up as question marks then maybe I can use you as a g-pig to test the numeric version to see if that works on your side of the fence? Could you try adding the decoration to this stuff in your environment and see what happens?


      "Never try to teach a pig to sing…it wastes your time and it annoys the pig."
        You're right, your HTML is the display problem for me. I use Konqueror (from KDE), which seems not to believe in some of the HTML entities you're fond of. I'll have to take this up with and/or KDE.

        (Memo to myself: Look at the HTML source next time.)

            -- Chip Salzenberg, Free-Floating Agent of Chaos

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://135494]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2022-08-13 10:02 GMT
Find Nodes?
    Voting Booth?

    No recent polls found