in reply to Re: Re: Re: Think for yourself.
in thread is the use of map in a void context deprecated ?
I agree... the use of map in a void context also makes me look for how the return value is used, because to me, getting a return list is the main reason for using map. This type of distinction reminds me of the section in perlstyle that says:
Just because you CAN do something a particular way doesn't mean that you SHOULD do it that way. Perl is designed to give you several ways to do anything, so consider picking the most readable one. For instance
open(FOO,$foo) || die "Can't open $foo: $!";is better than
die "Can't open $foo: $!" unless open(FOO,$foo);because the second way hides the main point of the statement in a modifier. On the other hand
print "Starting analysis\n" if $verbose;is better than
$verbose && print "Starting analysis\n";because the main point isn't whether the user typed -v or not.
To me, using map in a void context seems like "hiding" the main point of the code. And I'll point that out to people, but there are much more flameworthy transgressions. :-)
-- Mike
--
XML::Simpler does not require XML::Parser or a SAX parser.
It does require File::Slurp.
-- grantm, perldoc XML::Simpler
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: Re: Think for yourself.
by gwadej (Chaplain) on Oct 30, 2003 at 05:36 UTC |