I've never seen anyone here rail against optimization per se. But premature optimization is something to be avoided. Consider the classic example: two algorithms, A and B, accomplish some task X. A takes five days to write and is complex and difficult to maintain, but accomplishes X in one second. B takes one day to write, is simple and straightforward, but it takes five seconds to do X.

Which one do you use? The answer, of course, is "it depends." If X is some cronjob that runs once a month, it doesn't really matter if it takes five seconds of background process time, so there's no point in wasting time writing the hard version. On the other hand, if X is some calculation that must be executed thousands of times per day by users who need immediate feedback, then the one-second version is clearly preferred. And finally, how likely is it that X will change? Chances are the inefficient algorithm is more general and the efficient one more fragile.

Optimization is important -- but it's equally important to know when to optimize and to know what to optimize for.


In reply to Re: Optimisation isn't a dirty word. by friedo
in thread Optimisation isn't a dirty word. by BrowserUk

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.