On Fri, Mar 23, 2001 at 11:34:41PM +0100, Otto Wyss wrote:
> - Make readability your main objective. Readability is possibly the
> weakest part of Perl.

There's nothing fundamentally about Perl that makes it unreadable. Seriously.
Perl doesn't write unreadable Perl, people do. You can write some beautifully
readable programs in Perl. You can write some horrible programs in Perl too.
Try it. Take an algorithm and write it in as many ways as you can. Try and
make it as ugly or as beautiful as possible - the fact is, you *can* choose
how readable you want it to be.b

Oh, sure. So it has funny symbols. But it's a different language![1] It's just
like reading things written in Cyrillic. That's unreadable if you don't
know any Cyrillic. Well, duh. Once you know the alphabet, it's as clear as
day.

Or shorthand. Think about shorthand - that can look pretty unreadable. But
when you realise that it *is* shorthand and you shouldn't try and read it like
an ordinary text, it's fine. Regular expression syntax is shorthand.
/^.(\d{3})$/ might look daunting to someone who doesn't know the shorthand,
but it's perfectly readable to anyone who does. And to anyone who does,
writing it out longhand seems horrific:

$string->match->beginning->capture("digit", "digit", "digit")->end;

Much of Perl is the same, even though it *does* have considerably more
natural-languagey features than many other languages. Take phrase
construction, for instance. How many other languages let you say "X if Y" as
less as "if Y, X"? 

In short, no. Readability isn't the weakest part of Perl; it's the weakest
part of Perl programmers. "You can write FORTRAN in any language". Because
Perl gives people a means to express their thoughts in a manner more compact
than their ordinary natural language, they do.

Oh, and you think Perl is more English than German? Here's someone who doesn't
think so:

``Perl is the successfull attempt to make a braindump directly executable.''
    - Lutz Donnerhacke in de.org.ccc

[1] Why do people want programming languages to look like human languages
anyway? We use them for such completely different problem domains...

-- 
> I'm a person, not a piece of property.
Happily, I'm both!
    - Lionel and Stephen Harris.

Reply via email to