Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Print not printing

by monarch (Priest)
on Jun 24, 2005 at 07:53 UTC ( [id://469631]=note: print w/replies, xml ) Need Help??


in reply to Print not printing

Just goes to show that paranoia and excessive parenthesising is not such a bad thing after all..

Replies are listed 'Best First'.
Re^2: Print not printing
by Smylers (Pilgrim) on Jun 27, 2005 at 10:50 UTC
    paranoia and excessive parenthesising is not such a bad thing after all..

    Where can you put parens in the statement in question to make it be interpreted as addition printing to the currently selected filehandle? Others here have shown how a plus signs helps, but I haven't seen how parens would.

    What actually avoids this affect from hurting you is having a sane whitespace style — something which has many benefits.

    Excessive parenthesising is, by definition, excessive. Mostly in makes code harder to read for those of us who know (or can guess) the precedence rules — because you have to put effort in matching up the parens and satisfying yourself that they are indeed superfluous; they look so similar to necessary parens that they can't be quickly dismissed.

    Smylers

      I upvoted the previous post because the post author makes a valid point about excessive parenthesising being confusing.

      However two things make parenthesising easier: one, taking advantage of editor features that highlight the matching paren (Emacs does this wonderfully, and I've no doubt that other editors do this as well); two, the knowledge that things can sometimes go very wrong when precedence is just assumed.

      I tend to use more parens that most people.. that's not to say that sometimes I will rely on operator precedence from time-to-time. Although that got me recently when I incorrectly assumed the precedence of the ? : ternary operator.

      Code readability is always important, and if parens are clogging up readability, then indentation and splitting an expression over several lines isn't such a bad thing either.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-23 16:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found