Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^7: What operator should perl5porters use for safe dereferencing?

by BrowserUk (Pope)
on Jun 25, 2012 at 20:21 UTC ( #978262=note: print w/replies, xml ) Need Help??

in reply to Re^6: What operator should perl5porters use for safe dereferencing?
in thread What operator should perl5porters use for safe dereferencing?

I'd have to look much more closely to make sure nobody sneaks in a "~>" where it shouldn't be.

Sorry, but that is a bit of a crock.

~> versus ->, is certainly no harder to "detect" than . versus ',', (or $l .v. $1, O .v. 0 etc.) and the results can be equally mysterious and damaging.

If your font is unclear, use a proper programming font.

If your eyesight is poor -- as mine is -- use a bigger font.

Just want to note that I don't regard your opinions as wrong, they just differ from mine. I hope I'm doing a half-way decent job at explaining why I hold these views :)

Ditto! (And you have:)

Do you have anything against "?->" visually itself, or do you simply prefer "~>" for being more concise (or something else)?

My eyes/brain have become used over the past 30 years or so to translating -> into points at, without conscious effort.

In the smae way as you can raed tihs snetnce wihtupt dicffiluty dsetite the tpyos, I believe that I will be able to read $ref~>meth( $arg ) equally easily.

However, I think that every time I encountered $ref?->meth( $arg ), that ? is going to stand out like a sore thumb, ring an alarm bell, and throw a brake on my flow.

And given that the vast majority of the time, $ref~>meth( $arg ) will act exactly like $ref->meth( $arg ), that would be giving it a prominence that it simply does deserve or warrant. (IMO:)

Stated the other way, I think that when you need to notice it, ~> is sufficiently different; but when you don't need to notice, it is sufficiently similar to ->, as to not cry wolf in your subconsciousness.

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^8: What operator should perl5porters use for safe dereferencing?
by phaylon (Curate) on Jun 25, 2012 at 20:51 UTC

    As has been said earlier, it's very unpractical to change the font of every website, every editor, every email client, every IM, and so on, just to have the closeness not be a problem. Eyesight doesn't even come into it for me at this point :)

    And those examples you posted can be very problematic. They are exactly the cases why you need a good programming font that dashes the 0, gives "," bigger mass, and uses clever serifs. And I'd feel like this would just add another case. Maybe I read too much prose with inline code that isn't monospaced (and that I can easily slap my font on).

    I can see your point about the mental "points to" equivalency. I guess the "standing out like a sore thumb" is actually what I like about it. In my head "?->" reads as "(if possible (do what -> does))". So my mind basically wraps the "?" around the "->" (which is why I'd prefer the prefixed version over a postfixed one). And I'd like my brain to have it easy enough to always do that expansion quickly. It being a three-char operator helps me with that.

    Too bad we don't have something like a double-squiggly line in ASCII. That might be a good middle-ground.

    Ordinary morality is for ordinary people. -- Aleister Crowley

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2020-10-22 19:17 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (229 votes). Check out past polls.