in reply to Re^9: Modules for autogenerating accessor/mutator methods
in thread Modules for autogenerating accessor/mutator methods
I see your point, but I find it interesting that one of Perl's standard modules, AutoLoader, is there precisely to support the loading of subs upon first use.
Which prompts the question: why does Perl actively support such a problematic feature? Two possible explanations come to mind: (a) lazy loading of subs was a bad idea from the start (for the reasons you describe), and future versions of Perl should get rid of it; or (b) there are a few rare instances in which the benefits of lazy loading outweigh its drawbacks, hence Perl supports it.
If I know anything about Perl culture, then I'd guess that (b) is by far the more likely explanation of the two, and I'm left to imagining what those "few rare instances" may be like. The only situation I can envision in which lazy loading may be desirable (despite its drawbacks) is one in which the possible methods are vastly more numerous than those that are actually used by any application. But this is all theoretical, since I don't recall ever using a module that fit this description.
Update: Just to be clear: I'm not presenting the existence of AutoLoader or its presence in the core as a veiled argument in favor of anything. I am genuinely interested in the question of why it's in the core in the first place: was it a mistake, or is it there because there are some legitimate (even if rare) uses for it?
the lowliest monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: Modules for autogenerating accessor/mutator methods
by diotalevi (Canon) on Jun 05, 2005 at 04:17 UTC | |
by wazoox (Prior) on Jun 05, 2005 at 07:49 UTC | |
|
Re^11: Modules for autogenerating accessor/mutator methods
by tilly (Archbishop) on Jun 05, 2005 at 04:11 UTC |