[aklug] Re: perl doesn't natively do booleans?????

From: Arthur Corliss <acorliss@nevaeh-linux.org>
Date: Wed Aug 18 2010 - 16:08:45 AKDT

On Wed, 18 Aug 2010, Michael Fowler wrote:

> No, I am asking Perl programmers not to misuse prototypes. This means
> using them only for altering how subroutine calls are parsed, not for
> validation. The bugs introduced by using them for validation outweigh
> any benefit you get from compile-time checking.

:-) Well, that's more open than your original statement. I think the
biggest danger is for those that want to equate them to prototypes in a
strongly typed language. Tom was right that this "feature" was probably
mislabeled and should have been called something else.

I would still contend that my personal experience has found using them for #
of arguments validation has been very helpful, especially for your internal
code when you happen to break/change an API. I don't like doing so, but the
reality is that sometimes our first attempt at a functional interface
becomes very restrictive as you get deeper into a project. All those
invocations where I forgot to update the code become incredibly obvious.

> One example of a misuse would be to apply them to methods, where they
> are not only useless, but misleading.

Agreed. Though I will have to admit that I do use them on methods, but only
as an internal way to document what I expect as arguments. And, yes, I do
count the object reference in that template.

I think I'll now wait quietly while Mike plans my assassination... >8->

         --Arthur Corliss
           Live Free or Die
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Wed Aug 18 16:08:54 2010

This archive was generated by hypermail 2.1.8 : Wed Aug 18 2010 - 16:08:54 AKDT