Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re (tilly) 4: The Marcel Perl Questionnaire

by tilly (Archbishop)
on Feb 26, 2001 at 02:12 UTC ( #60787=note: print w/replies, xml ) Need Help??

in reply to Re: Re (tilly) 2: The Marcel Perl Questionnaire
in thread The Marcel Perl Questionnaire

The majority of the problems can indeed be solved that way. (Though good luck if you forget a local anywhere.) But there are more subtle maintainability issues with implicitly passing data in global variables. Code that is explicit about where data that is being acted on came from is better than code which hides that information elsewhere.

This is also why I dislike local. Oh, I know when to use it and I do use it correctly. But I prefer not needing it. Perl has too many scoping mechanisms whose interactions are too baroque. Rather few people really understand it, and when people are working with interfaces they don't understand they get confused and make mistakes. (Often without knowing that they made mistakes.) As the documentation says, local is probably not what you wanted to use, my is generally more appropriate...

  • Comment on Re (tilly) 4: The Marcel Perl Questionnaire

Replies are listed 'Best First'.
Re: Re (tilly) 4: The Marcel Perl Questionnaire
by premchai21 (Curate) on Feb 27, 2001 at 07:04 UTC
    Good point. However, I still disagree. You're right about the unmaintainability (though it fits in nicely with some of my patterns of obfuscation). I prefer local being there though -- I think that it has perhaps more uses than my does.
    Then again, TMTOWTDI... take your pick.

    Drake Wilson

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2021-04-17 03:07 GMT
Find Nodes?
    Voting Booth?

    No recent polls found