perl - sometimes it *does* resemble line noise... (long)
Paul Lussier
p.lussier at comcast.net
Fri May 12 10:55:01 EDT 2006
kclark at mtghouse.com (Kevin D. Clark) writes:
> Paul Lussier writes:
>
>> And there you have it. 'return map {...} map {...} grep {...}
>> split(...);' Short, concise, no need for a bunch of temp variables
>> that only get used once and thrown away. I like it. Others, well,
>> not so much :)
>
> If this is production code (not "write-once" code) in my opinion the
> original version of the code that you presented is preferable.
As I stated earlier on in the post, what I started with and ended up
with was largely the same. The multi-map/grep/split thing was the
result of a couple refactorings before I came to the same conclusion
:)
> I say this, of course, as somebody who is an enthusiastic Perl
> programmer. Code that is hard to understand and maintain will
> eventually either get rewritten or junked.
Yep, that's why I ended up using a bunch of temp. variables in the
end. Readability/maintainability was enhanced greatly at little/no
cost.
--
Seeya,
Paul
More information about the gnhlug-discuss
mailing list