Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I always quote the key left of an `=>'. It's because I had bad experiences with earlier perl version with CGI.pm, where things like $q->popup_menu(-values=>[...]) would give a warning and it took a long time for me to figure out that `values' is a perl function. :)

I think the way I figure things out, and it's a bit cargo-cultish; if I can't find what's causing the problem but I found something that stops the problem, then in the back of my mind I avoid doing whatever caused the problem. It sometimes comes back to bite you though, because you didn't take the time to figure out WHY there was a problem; or otherwise, you will end up spending lots of time and energy approaching a problem a certain way just because you try to avoid the "dangerous" method. So, like you say, you have these little superstitions. Then later you might accidentally discover the real cause, and those are happy moments of revelation. AHA!

I thought of another example of mine. I single-quote as much as I can, in the back of my mind thinking that maybe I'm saving a few cycles by not interpolating a double-quoted string. :)

I also always use qq{} for writing SQL or HTML strings. The reason for `qq' is often there are embedded quotes in HTML, and I forget to change the outside quotes. The reason for `{}' is in SQL there are often parentheses. I try to find the most general quotation for all cases to be consistent.

Also I tend to overuse CODE tags in perlmonks. ;)


In reply to Re: Coding superstitions by kwoff
in thread Coding superstitions by George_Sherston

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (6)
    As of 2014-07-24 23:24 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (167 votes), past polls