[Israel.pm] function prototypes

sawyer x xsawyerx at gmail.com
Wed Jun 11 06:01:27 PDT 2008


> > There is only one reason to use prototypes and that's for nifty and
> > nice looking functions that don't require parenthesis
>
> You forgot to add "IMHO", because without it this clame is false.

Apologies. Of course, this is all IMHO. :)

> I always use prototypes for the "look and immediately have an idea about
> the function arguments" reason. IMHO seeing ($$$;$$) in the function
> definition rather than just a function name makes the code a lot more
> readable. And of course, if you have a good use for (&...) or (\$...),
> then why not? :) Well, I don't need to repeat what I already said once
> to support function prototypes:
>
>  http://perl.org.il/pipermail/perl/2003-September/002997.html

I _personally_ (this time emphasized) have no prospect in your needs
of prototypes (which are quite valid on their own) because I feel my
functions are more dynamic towards my needs without limiting the
number of parameters and the number of them never indicates to me what
am I writing. That's what I have documentation (POD, hopefully) for.
Also, I don't use try {} catch type of coding - but I can see how
prototypes can be useful to some coders.



More information about the Perl mailing list