Charlie Stross writes:
> getting heavily into sorting algorithms). I'd be a bit happier if it was
> written as:
>    
>    sub fisher_yates_shuffle {
>        # Takes a single parameter, a reference to an array
>        my $array = shift @_;

I wouldn't :-)  If someone wrote 'shift @_' in a program that I was
reviewing, I'd strike out the @_.  The style I advocate is either

  my $arg = shift;
or
  my ($arg1, $arg2) = @_;

Anyway, we're straying far from home.  I'm working on a commit that
adds a comment describing the argument, and a variable name change
to $to_shuffle.  That should solve the problem. 

Lessons learned:
 * comment subroutine arguments in code
 * meaningful variable names beat programmatically-descriptive ones
   hands-down

Nat

Reply via email to