develooper Front page | perl.perl5.porters | Postings from May 2000

Re: Thoughts on maintaining perl

Thread Next
Tom Christiansen
May 25, 2000 14:41
Re: Thoughts on maintaining perl
Message ID:
>If you cannot understand this:
>    if ($x == 1 || $y == 2) {
>then I don't know what to say.  I just cannot fathom how that is hard to

What you can say, in that case, is that the reader has not yet
learnt to pull out the structural elements visually.  It's something
that readers unfamiliar with programming, or perhaps more especially
C-style programming, must first learn before they can understand
what they're reading.  It's like trying to read a regex without
first seeing the parens and pipes, which are essential to a first-level
understanding.  There are people who believe that

    if either x is numerically equal to 1,
    or else y is numerically equal to 2,
    then do

would be more "readable", but this seems dangerously close to COBOL,
something difficult to argue in favor of.

I'll have an article coming up "pretty soon" about this on
Being able to do two-level analysis of code at a glance is what
makes it more readable.  That's why parens are so important, whether
in be in normal or in so-called regular expressions.  Having to
engage brain to think about semantics of words and of precedence,
not clearly demarkated grouping, is what makes things slower to


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About