Re: if statement
- From: Dave Weaver <zen13097@xxxxxxxxx>
- Date: 31 Oct 2005 11:35:54 GMT
Tassilo v. Parseval <tassilo.von.parseval@xxxxxxxxxxxxxx> wrote:
> Also sprach A. Sinan Unur:
> >
> > Are you trying to make your code hard to read on purpose?
> >
> > my $newline2 = join(',',
> > 'code9',
> > $ENV{'REMOTE_HOST'},
> > $now_string,
> > $ENV{'REMOTE_ADDR'},
> > $query->param('email'),
> > $query->param('distribution'),
> > $query->param('-max'),
> > $query->param('-min'),
> > $query->param('~=use'),
> > $query->param('~=city')
> > );
>
> Come one, you can do better than that. ;-) The six calls to param() are
> a job for a type-writing monkey. Or map:
>
> my $newline2 = join ',',
> 'code9',
> $ENV{REMOTE_HOST},
> $now_string,
> $ENV{REMOTE_ADDR},
> map $query->param($_),
> qw/email distribution -max -min ~=use ~=city/;
I think Sinan's code is more readable than yours, and to me, code
readability (and thus quick, easy understanding) is much more
important than saving a few keystrokes. Cut-and-paste saves most of
those extra keystokes, anyway.
But I guess readability is in the eye of the beholder...
.
- References:
- Re: if statement
- From: A. Sinan Unur
- Re: if statement
- From: Tassilo v. Parseval
- Re: if statement
- Prev by Date: Re: RTF and UTF-8 files in Perl
- Next by Date: Re: OO Perl, iterators
- Previous by thread: Re: if statement
- Next by thread: Re: if statement
- Index(es):
Relevant Pages
|
|