Hacker News new | ask | show | jobs
by DougHaber 4163 days ago
I have written a lot of Perl code over the years, and I also hold the uncommon opinion that it is a great language, and often a far better choice than other similar languages for a lot of tasks. I agree with the author of this article that most people who criticize it are extremely ignorant about it.

The most common complaints about Perl tend to be about the code of people who don't know how to write Perl. Since when is it reasonable to judge a language on how the amateurs use it, instead of the professionals?

Perl does have its warts, but no language is an exception to that. When you learn to use a language well, the warts no longer matter. You get into the habit of writing code in a way that doesn't brush up against them, and that holds true for every language out there.

To clarify any mention of Perl 6, you need to realize Perl 6 isn't Perl. It is a whole different language with a really bad name. I know this has caused great confusion, but Perl 5 is extremely stable, still being developed, and not going anywhere. You don't need your Perl 5 programs to run in a Perl 6 interpreter any more than you would need them to run in a Python interpreter.

I have written my share of code in other languages, but I always return to Perl. As a C and Unix programmer, it feels like a very natural fit in ways that other languages completely do not. It has amazing string parsing, a superb (though extremely misunderstood) OO system, tons of great libraries, direct interfaces to POSIX and other system interfaces, really good database interfaces, networking, and protocol wrappers, very flexible interfaces to native code, and a really brilliant and well evolved design.

While you should always use the right tool for the job, Perl is a better choice far more often than people are realizing these days. There is so much anti-Perl sentiment out there, and the great majority of it is completely misplaced and made by people who haven't properly learned how to use Perl.

3 comments

"Since when is it reasonable to judge a language on how the amateurs use it, instead of the professionals?"

In a field like mine (computational chemistry) where most of the programmers are expert chemists but amateur programmers, then it's very reasonable to judge a language choice based on the expected user base.

I expect the same holds for most other computational-based sciences, where it may take 4 years to have the domain knowledge to start programming, even though the programming itself does not require deep knowledge of the language or of computer science and can be picked up in a few months of self-study.

> Since when is it reasonable to judge a language on how the amateurs use it, instead of the professionals?

Well, if you want to judge the appropriateness of a language for a given task, you will have to consider how it is going to be used by the people actually using it.

Maybe some super-disciplined Perl-gurus can write beautiful Perl code, but since Perl actively encourage ugly and unmaintainable code, the average developer will produce better code in a language like say Python which encourages readable code.

You can write ugly code in any language, and you can write beautiful code in any language. But that definitively does not mean that all languages are equally good at supporting and encuraging clean and maintainable code!

> gurus

It doesn't take a guru. Only anyone who actually cares about readability or learned from recent books like Ovid's Beginning Perl or chromatic's Modern Perl.

The main problem Perl has is not anything to do with its language. It's all the old books from the 90s (that some diehard still recommend), but which teach outright shit when it comes to readable or reliable code.

Clean and beautiful code has nothing to do with it being easy to understand or maintain. Those things are the result of proper abstractions, tests, documentation, etc. No language is going to teach amateurs that.
"Since when is it reasonable to judge a language on how the amateurs use it, instead of the professionals?"

What are your thoughts on PHP and Visual Basic (pre- and post-.net)? I assume that, under experts, they can be excellent languages. But that's not the typical opinion either.