in reply to Prototyping Subs: Good,Bad,Indifferent
In other programming experience I had developed the opinion that protypes were a good thing as they provide usage enforcementPrototypes in Perl are not analagous to prototypes in other languages. Calling them "prototypes" is a bit of a misnomer. But Tom Christiansen describes this better than I can.
I know many monks, myself included, only use prototypes to get subs to look like builtins, especially passing a bare block as the first argument (as in grep { ... }) or an array ref (as in splice @arr). They're ok occasionally for this kind of syntactic sugar, but they're not as useful as you'd think for actually enforcing parameters. As I said, read that article if you haven't read it yet, otherwise read it again ;)
blokhead
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Prototyping Subs: Good,Bad,Indifferent
by knexus (Hermit) on Aug 31, 2003 at 20:11 UTC |