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

Re: Handling braces with methods without arguments

by Jenda (Abbot)
on Sep 17, 2012 at 12:18 UTC ( #994027=note: print w/ replies, xml ) Need Help??


in reply to Handling braces with methods without arguments

Perl doesn't care, but in some well known languages the form without the braces would not call the method, but rather return a reference to the method (JavaScript and C# come to mind, not sure about Java ... though in C# it's a bit more complicated than that ...). Mainly to prevent confusion for people using those languages, I'd recommend using the second syntax. I don't see any reason to include the space within the braces.

Jenda
Enoch was right!
Enjoy the last years of Rome.


Comment on Re: Handling braces with methods without arguments
Re^2: Handling braces with methods without arguments
by McA (Priest) on Sep 17, 2012 at 12:54 UTC

    This is a nice argument which didn't come to my mind. Thank you. You forget python in the list.

    Best regards
    McA

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2014-12-26 21:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls