Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Thoughts on replacing -> with .

by hdb (Prior)
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1038199]
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: (3)
As of 2015-11-28 08:07 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (739 votes), past polls