Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: 'xor' operator is not a sibling to 'or' and 'and'?

by Anonymous Monk
on Dec 19, 2019 at 02:57 UTC ( #11110371=note: print w/replies, xml ) Need Help??

in reply to 'xor' operator is not a sibling to 'or' and 'and'?

Pretty please just remember that, although "xor" is three bytes, whereas "if {} then {}" is thirteen, "it simply doesn't matter anymore." Thirty years have passed and thank god they will never return. "Perl Golf" is gone, "clarity" is king. The programmers who are cleaning-up after they fired your ass will surely thank you. Thank you.
  • Comment on Re: 'xor' operator is not a sibling to 'or' and 'and'?

Replies are listed 'Best First'.
Re^2: 'xor' operator is not a sibling to 'or' and 'and'?
by GrandFather (Saint) on Dec 19, 2019 at 04:48 UTC

    What is this if {} then {} construct you speak of? It doesn't exist in any language I'm familiar with.

    That aside, what is the point you are trying to make? As a general thing smaller is better for clarity so long as you are being sensible. Single letter and generic variable names are not sensible. Being too clever is generally not sensible. Applying rules always is often not sensible. Breaking the rules often is always not sensible. So, what is the sensible point you are trying to make?

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

      An if {} then {} construct exists in Tcl, where then is an optional noise word, but Tcl has no equivalent to Perl's xor operator, so his comparison is still bogus. The Perl equivalent would be if () {} which is only seven characters (and Tcl accepts an equivalent if {} {} syntax) but it is still wrong because our questioner is talking about using xor as another type of fat comma in contexts where an actual comma or fat comma would cause perl's parser to extract an unintended meaning for the expression.

Re^2: 'xor' operator is not a sibling to 'or' and 'and'?
by Your Mother (Archbishop) on Dec 19, 2019 at 03:16 UTC

    No one who knows what golf is does it in production code and the single-letter-variable-name crowd straight outta C-ton has no idea what you’re talking about. “Clarity” in quotes from someone whose Perl is atrocious is just risible and like all LCD boosterism is more about catering to the worst than coaching to the best. You’ve been posting frequently the last couple days… what on God’s green Earth do you get out of it? Especially “anonymously.”

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2021-01-28 08:47 GMT
Find Nodes?
    Voting Booth?