Re: if statement



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...
.



Relevant Pages

  • Re: from elsewhere, an assembler
    ... for writing Application, which is the very true and only purpose ... multi-Instructions lines, for self-evident means, like readability, ...
    (alt.lang.asm)
  • Re: Onclick and onmouseover conflicts?
    ... The only purpose of camelHumpNotation is readability by humans, ...
    (comp.lang.javascript)
  • Re: Alternative decorator syntax decision
    ... Surely any English language keyword that gives a meaningful hint as to ... its purpose within a program has to be more readable than an arbitrary ... Readability is one of Python's key strengths and I would be very sorry ...
    (comp.lang.python)
  • Re: globals?
    ... In the latter case readability gets worse and the only way to make it better is by importing the 'Math' class. ... You can also say that other programming languages not providing the functionality VB provides make understinding VB code hard to non-vb "players", which is certainly often the case in practice. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: [PATCH] micro optimization of cache_estimate in slab.c
    ... separate static inline function for readability? ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ... Prev by Date: ...
    (Linux-Kernel)