in reply to Argument Passing, preference or performance ?
For 99% of what I do, clarity outweights performance considerations. So for clarity, I've adopted the following conventions:
This leads to code that looks like:
Code that's consistently written is easier to read, and code that's easier to read is easier to optimize. YMMV, or course.sub new { my $pkg = shift; bless { default => 1, @_ }, $pkg; # @_ might override 'default' } sub method { my $self = shift; my($shoesize) = @_; .... } my non_method { my($height, $width) = @_; ... }
|
|---|