Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I really don't want to get into a long debate about this but:

Because you are telling her, how she should program her code.

Isn't that in large part what Perlmonks is about? Or at least (because there is no code involved in this) offering well meant guidance.

And, (BTW) assuming (arrogantly) that she hasn't/didn't already profile both possibilities and choose appropriately.

Well, no actually. LA said "I thought about using delete, however the doc suggested emptying the lists would be faster.". No code involved. No test to see if there was a real issue. No consideration of which implementation might be easier to understand and maintain.

No attempt to help her. Just see the word (fast/er/est) and knee-jerk into patronizing dick mode.

Well, no actually. The advice offered was targeting the initial focus on speed instead of code clarity. Shaving a few micro seconds off something that only happens a few hundred times per execution of the script is almost certainly irrelevant.

In this particular case the code difference is likely to be small, but as a general thing concern over "the best way" can either make it almost impossible to make progress, or lead to very hard to maintain code that causes grief for ever. At $work an early coding decision for a C++ string object stores the actual string in a fashion that the debugger can't easily get at. At the time that probably made some string manipulations very slightly faster. Now compiler improvements mean that there is likely no performance advantage, but we get a major debugging disadvantage every time we want to see the contents of a string variable. The application using the string class does very little string manipulation so there is no performance improvement seen by users. The cost in developer time of that decision probably amounts to thousands of dollars.

So, I stand by my advice to LA and anyone else who bothers to read this far: Make it work first, then make it faster if you need to.

Perl is the programming world's equivalent of English

In reply to Re^7: I have a list expanding when I don't want it to by GrandFather
in thread I have a list expanding when I don't want it to by Lady_Aleena

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (6)
    As of 2019-10-19 11:59 GMT
    Find Nodes?
      Voting Booth?