in reply to Re^2: RFC: pragma pragmatic
in thread RFC: pragma pragmatic

namespace::autoclean is a module I've never had the need for.

If users of my OO modules -- and yes, I've written a few of those :) -- are diligent enough to look inside my modules and notice it has some undocumented methods imported from modules it uses, and they work out why and how to call them, that's fine by me. And if no one looks, those undocumented methods in the modules namespace, do no harm outside of it.

But then, I don't use Mooose, and I guess it needs all the help it can get. I guess it is conceivable that the presence of extra names in a modules stash could slow down specified method call lookup -- though I doubt anyone could measure the difference -- but then, I guess Moooose needs all the help it can get in that regard also. I also assume that the cleanup might return some memory to the runtime pool, though you wouldn't guess it from the size of every piece of Mooooose code I've ever seen :)


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". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit

Replies are listed 'Best First'.
Re^4: RFC: pragma pragmatic
by chromatic (Archbishop) on Aug 10, 2017 at 22:26 UTC

    The best reason I've seen for autocleaning a namespace is to prevent imported functions from being accidentally called as methods by a class's user. I can't remember seeing that problem myself, but something around the JSON module is tickling my mind.

      to prevent imported functions from being accidentally called as methods by a class's user

      I would have thought the automatic provision of the object handle as the first parameter would elicit sufficient errors to make tracking down the error/typo reasonably easy.

      (BTW: Good to see you back around.)


      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". The enemy of (IT) success is complexity.
      In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit

        Yeah, it always felt like more of a theoretical problem than a widespread one, given the pervasiveness of the function/method conflation in Perl. Perl's just not built for that kind of safety.

Re^4: RFC: pragma pragmatic
by Anonymous Monk on Aug 11, 2017 at 02:04 UTC

    Hi,

     use Wx qw(:everything); imports about 3.2MB worth of constants/"macros", so you can type (as in C++) wxDefaultSize instead of Wx::wxDefaultSize() and EVT_MENU(...) instead of Wx::Event::EVT_MENU(...)

    Some guys prefer namespace::autoclean to typing a few extra Wx::/Wx::Event::