in reply to Golfing and Sprinting

On the other hand, Knuth, among others, claim that "premature optimization is the root of all evil", for a few reasons:
Yes, good points, although I'd change the 'often' of the second and third points to 'sometimes' - assuming we talk about Perl here, and not C or assembler. Note however that these points all deal with full programs, probably running in production, and created while being paid.
Because of these problems, we should not encourage novices by indulging in such 'evil' speed optimization challenges.
That's a conclusion I don't want to draw. Typically the challenges presented here and in other forums are about a small piece of code, that's isolated from their context. I think that playing around with a small piece of code, trying out alternatives, consider what they do, without the burden of context is an excellent way to understand a language better.

Abigail

Replies are listed 'Best First'.
Re: Re: Golfing and Sprinting
by lachoy (Parson) on Mar 16, 2004 at 03:35 UTC

    It's always nice to bust out a Larry quote:

    Optimizations always bust things, because all optimizations are, in the long haul, a form of cheating, and cheaters eventually get caught.
    --Larry Wall

    Chris
    M-x auto-bs-mode

Re: Re: Golfing and Sprinting
by BrowserUk (Patriarch) on Mar 16, 2004 at 01:59 UTC

    Bravo!


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail