Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

comment on

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

Using parentheses, rather than relying on precedence, should be habit anyway for a good programmer.

I disagree! I disagree a lot! Knowing your precedence is a part of knowing the language. Sometimes, but just sometimes, adding parenthesis can add to clarity. Otherwise, I think they're just cluttering the code. You shouldn't put unnecessary "precedence parentheses" in Perl just as you don't do x + (y * z) when doing math. The desire to add parenthesis rather than to "rely on precedence" is usually a sign of uncertainty of the programmer who consequently does it "for safety". If you're not certain of the precedence for what you want to write, don't do yourself the disfavour of adding "safety parentheses", instead look in perlop. You'll soon learn the precedence well enough to not have to look there so often.

I found the node to be unnecessary hard to read. It would benefit from some editorial updates. It would be great to have paragraph titles. For the code that is on its own line it would be good to have it either indented or surrounded by blank lines, or preferably both. Adding code tags consistantly for all code parts in the text, including && and variable names, would also make it easier to read.


See perltoc if you don't know which perldoc to read!
Read argumentation in its context!

In reply to Re: if variants by ihb
in thread if variants by apotheon

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: (5)
    As of 2020-09-29 17:38 GMT
    Find Nodes?
      Voting Booth?
      If at first I donít succeed, I Ö

      Results (150 votes). Check out past polls.