Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: What am I not understanding about $,

by polettix (Vicar)
on May 20, 2016 at 06:38 UTC ( [id://1163585]=note: print w/replies, xml ) Need Help??


in reply to Re^2: What am I not understanding about $,
in thread What am I not understanding about $,

Ovid's reference to readability is wrong IMHO, the intent of "@array" is indeed clear.

That's unfortunate because it transformed a perfectly sensible suggestion about robustness - try to avoid global variables if you can, they might bite you in the long run - in a battle for idioms.

Some of your suggestions might be read in that light too, but I'd make them more explicit:

  • Variable names inside quoted strings? - are you thinking about overloading the stringification operator?
  • But what the hell is that dot doing there!? - are you thinking about overloading the dot operator?
  • ... I fail to see a reason why nested function calls might be detrimental from a robustness point of view though.

Operator overloading is definitely possible but highly improbable though as it's quite difficult (at least for me) to overload an operator in every possible scope. I'm eager to see comments about it, I'll be able to learn something about operator overloading at last :).

Anyway... I tend to consider operators safe and the transformations unneeded. (I would stress I in the last statement).

Personally, I always feel a strange tingling when using "@expand_me", and I do so only in very basic situations and temporary print statements for debugging. I prefer Ovid's way in code that has a longer lifespan. This is where I set the line between idiomatic and idiotic (couldn't resist the pun, sorry).

perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Io ho capito... ma tu che hai detto?

Replies are listed 'Best First'.
Re^4: What am I not understanding about $,
by BrowserUk (Patriarch) on May 20, 2016 at 07:55 UTC
    are you thinking about overloading the ?? operator?

    No. The point was simply that if you don't know perl, both those things are likely to be unreadable.

    I fail to see a reason why nested function calls might be detrimental from a robustness point of view though.

    Reductio ad absurdum, dear boy, reductio ad absurdum!

    You're taking my post far too seriously at the microscopic level; and ignoring forgetting my point at the macroscopic level.

    Personally, I always feel a strange tingling when using "@expand_me", and I do so only in very basic situations and temporary print statements for debugging. I prefer Ovid's way in code that has a longer lifespan.

    I can't say it better than I did in my next post in this thread: Being selective about what functionality you accept as legitimate, and what you personally choose to reject is one thing; attempting to impose your affectations upon the world at large is another. If you haven't read it, that same post goes into much more detail of my feelings about selectivity.

    I have no problem with your or Ovid's preferences -- I have my own -- but I do have a problem with Ovid's (and most other) justifications for rejecting parts of the language: ... nobody knows what $" is, but everyone knows what join() is.

    This is where I set the line between idiomatic and idiotic.

    I wish I said that. Then again, I probably will :)


    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". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Thanks for taking the time to point me to the other post.

      Again, anyway, I tended to read Ovid's suggestion in the light of robustness (where it seems to be adequate) instead of readabiliy, that's why I went down at the microscopic level. I understand that after reading too many suggestions like these you might snap though :)

      perl -ple'$_=reverse' <<<ti.xittelop@oivalf

      Io ho capito... ma tu che hai detto?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-05-27 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found