Keep It Simple, Stupid | |
PerlMonks |
Re: Re: Re: Re: Re: The costs of packagesby demerphq (Chancellor) |
on Sep 17, 2003 at 21:56 UTC ( [id://292267]=note: print w/replies, xml ) | Need Help?? |
Ie. run-time verification, rather than compile-time, but that is a small price to pay for the benefits it produces. But an entirely perlish approach :-) The original question was just trying to clarify what performance impact having hundreds of unused minimal packages floating around would have, and whether any such impact would be reduced by moving those minimal packages below a single, top level namespace, rather than each existing in the top-level namespace. And its an interesting one that Im glad you raised as I, for one, have never thought about this. Of course theres an overhead but it never ocurred to me to think about it. I never consider it premature to think about the overall impact of my designs upon the programs that will use them. I beleive it to be good design to do so. Only by thinking about such things do you avoid the 'bloat' syndrome that we all love to hate in Word and other similar programs. No I agree. But there is taking it too far, and for me I think my counter-question was just as valid as yours, and still not entirely resolved. :-) A lot of times a person with a completely fresh view is able to spot the "flaw" in a plan. Having had people ask me to justify some interesting optimisation on occasion and not being able to come up with a good answer more than once says to me that its always fair to second guess such thinking. However this does not mean that I think your question shouldnt have been asked, just that this was a fair response. Abigail's neat solution with the UNIVERSAL package bypasses these concerns and results in a solution that from my perspective has almost no downsides. Having this brought to my attention completely vindicates both my having thought about the impact and asking the question. Agreed, its been a thought provoking thread. However, I still stand by the comment that any time you start getting obsessed with optimization, its worth a deep breath and to ask yourself if its really needed... You just have to admit that on occasion it is... :-) As somebody once said, theres a fine line between premature optimisation and mature optimisation. :-) --- demerphq <Elian> And I do take a kind of perverse pleasure in having an OO assembly language...
In Section
Seekers of Perl Wisdom
|
|