in reply to Re^3: The trouble with Perl Idiom
in thread The trouble with Perl Idiom
Musing about its efficiency therefore seems like a rather pointless excercise. </code>
I just don't see the point in looping twice when a single loop will do. Each loop has its overheads regardless of how many elements are involved, so why incur them twice when the readability gain is low? In fact IMO a lot of maintenance programmers won't even know what 'grep' does but will probably guess correctly what 'next if' does. So you aren't really improving readability for the price of a definite efficiency loss.
I've only seen one or two situations where I felt 'for grep' or 'map grep' made much sense. *shrug* :-)
First they ignore you, then they laugh at you, then they fight you, then you win.
-- Gandhi
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: The trouble with Perl Idiom
by hv (Prior) on Aug 30, 2004 at 11:06 UTC | |
by demerphq (Chancellor) on Aug 30, 2004 at 11:21 UTC |