Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Exporting functions into main namespace for the benefit of other use'd modules

by BrowserUk (Pope)
on Jul 10, 2003 at 21:36 UTC ( #273150=note: print w/replies, xml ) Need Help??

in reply to Exporting functions into main namespace for the benefit of other use'd modules

If you are really going to 'globally expose'(1) utility functions this way, then you should at least give some thought to the names, and get_id() is just about as bad as it gets.

(1) Which seems to be your intention, though as halley pointed out the definition of global is somewhat limited.

What id is that? A file identifer? A personnel identifier? A user identifier? A group identifier? A rabbit identifier? Is Idaho up for sale? Your program is a step in your quest for world-domination and your starting with Indonesia?

Or maybe the problem you are solving needs a little Freudian help, and some impulsive behaviour?

And is that get a new one? The old one? The only one? The current one? The next one?

Once you have addressed those questions, your likely to end up with a sub called retreive_current_effective_user_id_for_this_process();, but then that would probably be more easlily written as Process::Current::user_id(); (season with get/put, or get/set to taste).

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller

Replies are listed 'Best First'.
Re: Re: Exporting functions into main namespace for the benefit of other use'd modules
by tunaboy (Curate) on Jul 10, 2003 at 21:51 UTC


    First off, thanks for the levity. But it also, as I assume you intended, points out a very valid problem.

    My only response is to say that the name makes perfect sense in context. But I obviously did not supply the proper context, and perhaps it would not make perfect sense to someone else.

    The id refers to a unique id that is required by each wxPerl object that is part of the application (eg textboxes, buttons, frames, etc.).

    This whole thread has got me thinking on the question of whether I can assume a minimum level of knowledge about the overall application or if each module that makes up the application has to stand on its own.

    Thanks for the response.

      i think you may be better served by OO, using functions as objects.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2020-10-31 01:04 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (286 votes). Check out past polls.