Hacker News new | ask | show | jobs
by michaelwww 1378 days ago
I don't think it's hate. I think it's more "why would I choose Perl over Python?" Perl has a painful syntax, Python greatly improves on this with easy syntax. I don't want to have to relearn the syntax every time I reach for a scripting tool.
6 comments

> Perl has a painful syntax, Python greatly improves on this with easy syntax.

Regular expressions are way better in Perl. I increasingly find myself going back to Perl for RE heavy projects because it's so cumbersome in Python by comparison.

I'm still undecided on if Perl needing semicolons everywhere is only 'as bad' or 'worse' than Python forcing you to worry about the exact number of tabs/spaces indenting lines, but I'm leaning toward python being easier in that respect.

Still, when I have to get something done quickly, especially if it's an immediate need I don't see having to worry about later, Perl is what I turn to. Everything in Python becomes a "Project".

> Perl has a painful syntax, Python greatly improves on this with easy syntax.

That's a matter of opinion. C style languages are a lot easier for me than whitespace significant languages; my editor will go to the matching bracket with ^G, but I can't do that with whitespace to get to the end of a block. The type sigils are a bit tricky to figure out, but if you spend the time to understand it, it makes sense (but that's also a mater of opinion, too).

Nobody complaining about Perl's syntax is complaining about the "C style". Reading the arcane incantations of magical $ variables gets really old really fast, Perl takes the "if it was hard to figure out then the code must be hard to read" to a whole new level. It's probably the only mainstream non-functional language where you can be absolutely unable to decypher a snippet of code even though you know another C-like language.
> Perl has a painful syntax, Python greatly improves on this with easy syntax.

I use Python and Perl. Some people who like Python want everything to be Python and "hate" anything that isn't Python. It approaches zealotry in some cases.

Perl syntax is expressive and is similar to C, C++, Java, and yes Bash. These are successful languages too despite not being pythonic.

I'd use PHP before I'd use PERL. PHP has experienced some dramatic improvements in the last 5 years
Sure, if you're a fan of Java verbosity. Since PHP 5.3 I don't know why Zend didn't just re-brand PHP as Java Lite. I also don't get why Rasmus allowed the Zend team to get away with it since at heart he's a procedural C guy.
Python was an obscure algorithms language until Google standardized around it, if they hadn’t we wouldn’t be talking about it. Not to say it’s good or bad since that’s silly and evaluating languages is complex and context sensitive, but IMHO Python isn’t popular because it’s great, even if it is.
The reason to use Python instead of Perl is that you can do `python3 -mvenv env`.

Actually using the language itself is far less painful in Perl than it is in Python.

Sure, but there are a lot of times where if you care about performance you should use Perl. General purpose? Sure, Python.