On Mon, Oct 08, 2001 at 10:30:03PM -0600, Chris Fedde wrote:
> On Mon, 8 Oct 2001 16:54:42 -0600  Nathan Torkington wrote:
>  +------------------
>  | Lessons learned:
>  |  * comment subroutine arguments in code
>  |  * meaningful variable names beat programmatically-descriptive ones
>  |    hands-down
>  +------------------
> 
> Your comments are well taken and have been used to illuminate the
> patch below.  Because the subroutine does not use any prototyping
> I've removed the prototypish comment.  I'll not comment on if it
> would be better written with a prototype.  I'm not fond of variables
> that are named as verbs or verb phrases, so $to_shuffle rankles.
> Perhaps my changes meet with your approval.

I don't really care whether you use a prototype or not, but you are wrong
that the subroutine doesn't use any prototyping.

         sub fisher_yates_shuffle (\@) { }

*is* different from

         sub fisher_yates_shuffle (@) { }

The first allows you to write:

         fisher_yates_shuffle @deck;

while the second requires you to write:

         fisher_yates_shuffle \@deck;

I do prefer the first one. However, since this fragment is about shuffling
and not about prototypes, I don't feel too strongly about it. But it was
there, and I've heard noone ever having a problem with it, so why change?



Abigail

Reply via email to