[JOB] Perl Software Developer and Database programmer
Andy Armstrong
andy at hexten.net
Thu Feb 23 13:48:01 GMT 2006
On 23 Feb 2006, at 13:30, Dominic Mitchell wrote:
> But this is actually the /correct/ idiom for OO code:
>
> sub mymethod {
> my $self = shift;
> my ( $arg1, $arg2 ) = @_;
> ...
> }
>
> ie: shifting the object of the front of the arguments array because
> it's
> not really part of the arguments.
I think the point was the '# loads of code'. If the arguments are
pulled out of @_ in different ways spread randomly through a big
chunk of code you're likely to screw something up later. Argument
gathering should usually be largely orthogonal to whatever else is
going on in all but short subs.
--
Andy Armstrong, hexten.net
More information about the london.pm
mailing list