Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Thoughts on replacing -> with .

by hdb (Parson)
on Jun 11, 2013 at 06:48 UTC ( #1038199=note: print w/ replies, xml ) Need Help??


in reply to Thoughts on replacing -> with .

Coming from a C++ background (though not having used it for a long time), it always made a lot of sense to me, that the method call operator is ->. After all, objects in Perl are used via references, which is closer to a pointer to an object than to an object itself.

Loosing the dot as string concatenation is IMHO a rather severe event. The tilde is a bad replacement choice, in particular in the form of the assignment operator. $str ~= "ccc" will be concatenation, $str =~ "ccc" will be matching. Quite confusing and a likely cause for error.

The visual appearance of -> versus the dot for calling methods is a bad guide in my opinion, not even taking into account that code will look more like VB than classic Perl. What will be gained in changing -> to dot, will be lost from the change of the dot to the tilde. There is good reason that this character only appears rarely in code and usually in conjuntion with the equal sign to form the matching operator.

The esthetics of well written Perl code contrasted with the visual appearance of a tilde separated file. What a terrible outlook!


Comment on Re: Thoughts on replacing -> with .
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2014-07-25 11:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (170 votes), past polls