Jay wrote:<br/>
> Should I make these each 5 liners instead?<br/>
<br/>
Whenever I ask myself that question I find that "yes" is the
correct answer in the end. ;-)<br/>
<br/>
As nice as the single line solution is, are you going to be the one that
will be the sole caretaker of this section of code until the day it dies
-- the day _YOU_ die is not an option! :-) If not, do the others on
your team have a similar comfort level with this code? In general, I
ask myself this question: "At 3:30 AM, will we be able to look at
this code and understand it with minimal thought?"<br/>
<br/>
On the other hand, if this code is called a for each line in a million-row
database lookup for each query, which one is faster? That might be
the key -- if so, you might want to put a comment in that readability was
sacraficed for speed in this case.<br/>
<br/>
Dan<br/>
<br/>
On Wed, March 22, 2006 12:09, Jay Hannah wrote:<br/>
> Wow. Is this readable? I think this is the first time in my life
I've<br/>
> intentionally used $#_ (or any $#x for that matter...)<br/>
> <br/>
> sub set_rate_single {<br/>
> $_[0]->SUPER::set_rate_single($_[0]->rate_split_shrinker(
@_[1..$#_])) }<br/>
> sub set_rate_double {<br/>
> $_[0]->SUPER::set_rate_double($_[0]->rate_split_shrinker(
@_[1..$#_])) }<br/>
> sub set_rate_xperson {<br/>
>
$_[0]->SUPER::set_rate_xperson($_[0]->rate_split_shrinker(@_[1..$#_]))
}<br/>
> <br/>
> Should I make these each 5 liners instead?<br/>
> <br/>
> j<br/>
> <br/>
> <br/>
> The long way would be:<br/>
> <br/>
> sub set_rate_single {<br/>
> my ($self, @rates) = @_;<br/>
> my $result = $self->rate_split_shrinker(@rates);<br/>
> return $self->SUPER::set_rate_single($result);<br/>
> }<br/>
> ...ditto double<br/>
> ...ditto xperson<br/>
> <br/>
> <br/>
> _______________________________________________<br/>
> Omaha-pm mailing list<br/>
> Omaha-pm@pm.org<br/>
> http://mail.pm.org/mailman/listinfo/omaha-pm<br/>
> <br/>
<br/>
<br/>
- - - -<br/>
"Wait for that wisest of all counselors, time." -- Pericles<br/>
"I do not fear computers, I fear the lack of them." -- Isaac
Asimov<br/>
"Soon we will be able to harness the rotational energy from Orwell's
grave to solve all world energy problems." -- /. user GigsVT
(208848)<br/>
GPG fingerprint:6FFD DB94 7B96 0FD8 EADF 2EE0 B2B0 CC47 4FDE 9B68