Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: if variants

by ihb (Deacon)
on Oct 20, 2004 at 01:01 UTC ( #400723=note: print w/replies, xml ) Need Help??

in reply to if variants

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!

Replies are listed 'Best First'.
Re^2: if variants
by apotheon (Deacon) on Oct 20, 2004 at 01:14 UTC
    I've taken your suggestions and comments under consideration, and made some edits. Thank you.

    - apotheon
    CopyWrite Chad Perrin

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://400723]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2020-09-26 05:11 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (141 votes). Check out past polls.