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


In reply to Re: Golfing and Sprinting by Abigail-II
in thread Golfing and Sprinting by kvale

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.