Thursday, August 6, 2009

why i hate reading perl code (aka why I hate Perl)

After going through line after line that looks like this:


my $targetFooThingie =
"$object{fooBarDir}/$fooType/$config_layerThingieName[$layer]";


my nose starts to bleed....
I hate the embedded variable thingie (aka variable interpolation). And the total abuse of punctuation marks just makes things worse.)


PS. perl zealots and fundamentalists, go away. This is my blog and I'll post whatever I want. Thoughtful and insightful comments are most welcome. (Not that I've ever gotten a comment here. Too insignificant of a blog.... ;)


Added 13 August 2009

Given the comment by chorny, I feel the need to explain this point.

It's not the string interpolation per se that I find nosebleed inducing. Like he said, string interpolation in some form is present in all major scripting languages. What I find totally annoying is the way Perl does it. IMNSHO, it was a bad idea to to it The Perl Way as shown above. It makes a simple string concatenation operation doubly difficult in terms of deciphering what's going on.

As I don't know Ruby or PHP, I can not comment on those languages. And given that it looks like PHP is probably a clone of Perl, I probably won't be learning that language any time soon. And I hear that there are a lot of Ruby fundamentalists/zealots given that it's the latest Cool Language, i probably won't be in a rush to learn it either.

7 comments:

chorny said...

This feature is available is several other languages like PHP and Ruby. Python formatters are also near.

And I don't like (I don't say hate - Perl zealots are usually polite) Python whitespaces and many other features in other languages :).

raoul said...

Instead of ad hominem attacks like implying that I'm "impolite" to hate Perl, why don't you post something constructive?

BTW, I hate the Perl programming language. I don't hate Perl programmers. I do hate fundamentalist zealots who use personal attacks to justify their own personal taste in programming languages. And funnily enough, there are a lot of such zealots who find it their personal duty to attack anyone who professes a hatred in Perl. (BTW, thanks for being exhibit A.)

So let me repeat myself. I hate Perl. My blog. My opinion.

Any more personal attacks left on this blog will be simply deleted.

Have a nice day.

raoul said...

Here's something to think about:

Why I Hate Advocacy

chorny said...

Why you hate only Perl for feature that is available also in PHP and Ruby (and maybe Python)?

raoul said...

The blog post is one of the reasons I hate Perl. I will be posting more in the future but as a preview here are some reasons:

1. length( @a ) does the Wrong Thing.
2. Unwrapping @_ sucks. (Yes I know There Are Other Ways To Do It, but the vast majority of perl scripts I've had to read use the unwrapping of @_)
3. Using the language well means a ton of memorization. Hint, take a look at this.
4. List flattening. (Now there's a bad idea)
5. To compound #4, references. (BTW, I'm an embedded C programmer and I eat pointers for breakfast.) References were introduced so that Perl can have nested data structures.

There are probably more but these are at the top of my head. Feel free to disagree. But there you are. My personal opinion on the things about Perl that suck.

raoul said...

Correction: The blog post details one of the reasons I hate Perl.

raoul said...

More correction: meant unrolling not unwrapping.