5 ms·
Let's say I don't know any server side language. Why should I learn Perl when Php is ALWAYS loaded and configured on every single server, was literally built fo
by tomasien 14y ago
Let's say I don't know any server side language. Why should I learn Perl when Php is ALWAYS loaded and configured on every single server, was literally built for MySQL, while Python and Ruby and hotter (and more intuitive) with better MVC frameworks and libraries behind them, why?
I'm not being facetious, I really want to know the reason I would do that. I buy the "Perl is better than C" argument 100%, but how is it better than Php, Ruby, or Python ESPECIALLY for someone picking their first server side language?
- mst 14y agoYou might not be being facetious, but you have clearly already decided that python/ruby have better libraries for whatever definition of "better" you're using. Personally, I'd avoid PHP as a first language because it's, well, kind of an abomination of a language even if the community have done some awesome things with it. As for perl/python/ruby? I usually suggest to people that they should write at least some code in each of the three; you end up as a better programmer as a result and besides, it's fun :)
- tomasien 14y agoI have not at all made a decision, I'm seriously soliciting feedback while explaining the biases I have coming in.
- mst 14y agoThen my suggestion to experiment with all three stands. Things you might want to look at for Perl - Moose/Moo for OO, Mojolicious/Dancer/Catalyst for web frameworks, DBIx::Class/Rose::DB::Object for ORMs, App::cpanminus/App::perlbrew/local::lib for managing installations of Perl and modules, and http://metacpan.org/ http://metacpan.org/ for looking up libraries for everything else. Also, the free book "Modern Perl" to get a feel for the language in 2013 as opposed to the hundreds of horribly outdated .com-bubble era tutorials you'll find on google. You'd be best with somebody else's advice for python or ruby, most likely, so I shan't opine there.
- zoul 14y agohttp://mojolicio.us http://mojolicio.us would be one such reason.
- adrianhoward 14y agoI'm not being facetious, I really want to know the reason I would do that. I buy the "Perl is better than C" argument 100%, but how is it better than Php, Ruby, or Python Off the top of my head. * I'd disagree that other languages have better libraries and frameworks than Perl. Perl has some pretty darn awesome libraries and frameworks. * It has the best testing infrastructure in any language I have ever used. Period. * The Moose OO layer has some really rather nice things for composing large OO projects * Because something doesn't have to be better than another language to still be worth learning * Because there's a shit load of perl out there - and knowing how to deal with it well will probably make your life easier. * Because learning new languages always tweaks your perspective in useful ways in my experience * Because the Perl "infrastructure" (CPAN, metacpan, CPANTESTERS, CPANTS, etc. etc.) is still best of class. I so wish I could have reports like http://static.cpantesters.org/distro/D/Dancer2.html http://static.cpantesters.org/distro/D/Dancer2.html in the Python, PHP, JavaScript or Ruby world. * Because Perl takes backwards compatibility and keeping old code running very, very seriously. Shit just stays working.
- __david__ 14y agoPerl is also installed on virtually every server. Seems most people are using Ubuntu nowadays and it's definitely there by default (much of the Debian infrastructure is written in Perl). I believe the same goes for Red Hat. As to your actual question, I'm not sure I'd say that Perl is better than Php/Ruby/Python. I really consider them all mostly the same. There are bits and pieces of each that is better than the others, but nothing overarching. If you know one of them really well, I don't see a huge reason to learn another one of them to the same level (unless some sort of outside influence compels you). Perl's strength has traditionally been CPAN, but Ruby and Python both have their own copies and communities big enough that most of the stuff you look for is already there. The Perl community's documentation is also superior to almost anything else out there. Once I've CPAN installed a package (say Template::Toolkit), I just "man Template::Toolkit" and there's a ton of documentation sitting there, including examples. The convention in the community is to put the example at the very beginning, which is heavenly, and cannot be appreciated enough. In contrast, the Ruby community's documentation is largely a joke. It seems most of the time the documentation for a gem is in the README on github. And even then, to really learn it requires diving into the code. But then it isn't clear what is or isn't supposed to be a stable API. Perl seems to do that way better than Ruby. Python always seems to have docs you can get to with pydoc but from what I've seen they tend to be auto-generated from the API with a lot of "FrotzBlubb() - This function Frotzes your Blubb" style non-documentation. So it has the sheen of documentation but it's not actually really helpful. That being said, I learned Perl in 1994 or so and recently did a Ruby project. I quite enjoyed it and have been forcing myself to do new things in Ruby to keep up my language skills. I do miss the good documentation in Perl though (the Ruby community really needs to take note). Also Perl just seems faster than Ruby (I have no evidence, it just feels that way).
- tomasien 14y agoThank you all for your thoughtful responses! I really hope I did a good job conveying that I seriously did want feedback on this question, and my counter-arguments to Perl were simply to alert you to my biases going into the discussion. Anyway, from these responses, I would say there is no compelling reason to learn Perl as a beginner or advanced-beginner, but perhaps for someone beyond that point there are some decent ones.