Thomas Wittek skribis 2007-05-14  0:42 (+0200):
> excessive use of special characters (/\W/).

This seems to be "I don't like regexes". Ignoring for now that Perl 6
regexes will be more verbose and thus easier to read for someone without
much prior exposure to them, what would you suggest as an alternative to
regex matching?

One of the common alternatives is to iterate over a list of characters,
possibly using an index. Would you say that a screen page full of such
code is easier to read and maintain than a single regex on a single
line?

Many languages have regexes, even the cleanest among them. And they're
all as messy as Perl's. They're often more verbose on the outside, which
can result in something like foo.match(/foo/) instead of foo =~ /foo/,
but the /foo/ part is most important here. If you don't recognise what
that is, it doesn't matter if ".match" or "=~" was used.

Many languages have regexes, but Perl was probably the first to apply
them heavily in "normal" programming. And nowadays, they're so
ubiquitous that it's hard to find a language without Perl-ish or "Perl
compatible" regexes. Why do you think this is?

I think it's kind of funny that indeed exactly the most cryptic part of
Perl's syntax is copied to so just about every modern programming
language, while at the same time Perl is constantly criticized for using
"special characters" so much.

No, special characters aren't a problem. They are the fundament of a
very powerful and expressive syntax. Just don't try to understand a
screen full of them all at once -- realise that in another language, the
first three lines would sometimes already fill the same screen, and
adjust your reading speed.

On the other hand, the overall structure of a program is often more
obvious, exactly because so much more fits in one screenful.

In Perl it is often not needed to refactor something to many tiny
subroutines with verbose identifiers, just for legibility.

One thing stays true, though: Perl is very hard to read for someone who
doesn't know Perl well enough. But that's practically true for almost
language, be it Python or Japanese.
-- 
korajn salutojn,

  juerd waalboer:  perl hacker  <[EMAIL PROTECTED]>  <http://juerd.nl/sig>
  convolution:     ict solutions and consultancy <[EMAIL PROTECTED]>

Reply via email to