[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

Re: (techy) Code specs?

On Sun, Nov 15, 1998 at 11:26:23AM -0500, Mark-Jason Dominus wrote:
> > Some but not all of the functions use prototypes. 
> I honestly do not understand what the prototypes are there for anyway.
> I imagine that someone put them there because they thought that they
> were going to get better argument type checking, because that is why
> other languages have prototypes.  But that is not what Perl prototypes
> are there fore.  Perl prototypes do not provide better argmuent type
> checking.  Instead, they are there so that you can emulate the
> behavior of the Perl internal functions.

Actually, Perl does provide argument checking when you use the -w option.
Also, the prototypes help document the expected number of arguments.

> Also, most function calls use the `&f' form, and that form disables
> the prototype checking anyway.

Another reason not to use that form.

> Prototypes suck.  

Well, I'm willing to live without them if everyone else hates them,
but I've found them very helpful when I change the number of arguments
a function takes to ensure that I change every function invocation!
This has already happened several times during the development of zigzag.

	*** Xanni ***
mailto:xanni@xxxxxxxxxx                         Andrew Pam
http://www.xanadu.com.au/                       Technical VP, Xanadu
http://www.glasswings.com.au/                   Technical Editor, Glass Wings
http://www.sericyb.com.au/sc/                   Manager, Serious Cybernetics
P.O. Box 26, East Melbourne VIC 8002 Australia  Phone +61 3 96511511