Hacker News new | comments | show | ask | jobs | submit login

That question can be turned around: Why should someone use Python (or Ruby) instead of Perl?

For someone who hasn't used any of those, I'd say give each of them a few hours and see which style suits you best. Of course, try to find modern examples to learn from. When it comes to Perl that means:

* Mojolicious [1] (or Dancer [2]) as the web framework

* DBIx::Class [3] as the ORM (maybe with some sugar [4])

* Moose [5] (or Mouse or Moo) as the object system

[1] http://mojolicio.us/

[2] http://www.perldancer.org/

[3] https://metacpan.org/module/DBIx::Class

[4] https://metacpan.org/module/DBIx::Class::Candy

[5] https://metacpan.org/module/Moose

Python and Ruby both have garbage collectors and can deal with reference cycles. Perl only has reference counting, leading to programs that leak memory due to reference cycles and needing to hunt down where in the code you're creating them.

It's the only high-level language I know of that only has reference counting for memory management.

and because of that, it often runs much faster, as well. Having an interim choice between "full GC" and "malloc/free" is a nice option, in some cases. Particularly for small programs/scripts that churn through a lot of data (so long as you don't build a cyclic graph data structure while scanning)

> It's the only high-level language I know of that only has reference counting for memory management.

It's also the only high-level language I know of that can't really be parsed ("only Perl can parse Perl" they say).

It's a dead language really, you can also see this from the number of noisy evangelists vs. professional users nowdays (and that comes from someone who has used Perl almost exclusively for the past 10 years), if you couldn't see it from the diminishing quality of important modules on CPAN (e.g. I pulled my hair today over JSON::XS generating '-inf' from values on one side and crashing on the other side while trying to parse it).

So, I'm learning Go now and improving my JS skills.

"you can also see this from the number of noisy evangelists vs. professional users nowadays"

Actually, where I work, we use Perl almost exclusively. I don't know a single person who I would consider a "noisy evangelist" - we just quietly get stuff done.

Maybe the noisy evangelists are the only ones with enough confidence to publicly proclaim that they use Perl. The others lack confidence and don't publicly announce it because the general programming community responds with disdain / pity.

Nah I've never met anyone in the Perl community who seemed to care much about what other people thought about their language choice. Also most Perl developers I've met tend to be polygots so they're less likely to be the yelly "THIS IS THE ONE TRUE LANGUAGE" type.

There is a Steve Yeggie quote, though its not necessarily praise for Perl, which always pops to mind when people have a rant about Perl:

'As I've done for a great many other programming languages, I've bashed on Perl's technical weaknesses at length in the past. To my continued amazement, the Perl folks are the only ones who never get upset. They just say "Haha, yeah, boy, you're right, it sure is ugly. Heh. Yeah, so, um, anyway, I'm going to get back to work now..." It's awesome. I've gained so much respect for them. It's almost enough to make me go back to programming in Perl. Well almost.'

Edit: Quote reference: http://steve-yegge.blogspot.com/2006/10/egomania-itself.html

I agree with your bet on JS and Go.

Even though the lack of a garbage collector is a factor, I doubt that it is the biggest reason.

I was bit quite nastily by the lack of garbage collection in Perl just a couple of months into using it.

However, perl proved itself as an invaluable tool for quickly trying out ideas, and I was loyal to it for at least 10 years. Perl just wasn't able to grow as strong as the alternatives did.

It's strange then that memory leaks seem to be much more prevalent in Ruby than it is in the Perl world?

It's hard for me to give up my "perl on the command line" habit. As far as I could tell, Python has no equivalent of "perl -n -e ...", and Ruby is seldom installed on machines at work.

I think that Ruby would be a better choice for some of the scripts that come up here and there at work, but inertia keeps much of it in perl. When I've taken the effort to install something for scripting, it has usually been Scala or Groovy, so as to make use of application code within the scripting.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact