|P is for Practical|
Re: Exporting functions into main namespace for the benefit of other use'd modulesby BrowserUk (Pope)
|on Jul 10, 2003 at 21:36 UTC||Need Help??|
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