Perl receives such an unnecessary amount of hate
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.
Not Your Grandfather’s Perl
161–170 of 257 posts
Re: Not Your Grandfather’s Perl
#162Earlier quoted context omitted.
The point is not about `say` itself (which has been there since Perl 5.10, released on 2007/12/18), it's only an example of how much Perl uses modularity (via `use`) to enable new features while ensuring a) code dependent on a new feature alerts on Perl versions without the feature and b) backward compatibility of new Perl versions with old Perl code. Compare: # Perl use feature 'say' vs: # Python from __future__ imp…
This. So much this. At the $dayjob, writing some python assuming late model 3.10.x, and discovering that the API has changed when I have to make sure it works on 3.6.x and 3.7.x. Nevermind important libraries like pandas changing the API so some functions you 've used for years just disappear. I've got 30+ year old perl 5, that just works. And is readable. I wish 2 year old python could just work.
Re: Not Your Grandfather’s Perl
#163Earlier quoted context omitted.
I would argue that ruby as almost all the strengths of perl and conciseness with more coherency if you want a perl-like fluidity and terseness. I personally like python for anything that becomes more than a 100 lines of bash.
Due to poor coding practices (eg monkeypatching) and a weaker testing culture (by default Ruby does not run unit tests when installing libraries) I've found Ruby to be substantially less reliable than Perl. However the world has moved on to Python. So I curse every time I again have to look up how subprocess works for what I'd do in Perl with backticks.
It supports mac, Linux and windows.
Re: Not Your Grandfather’s Perl
#164> $time->month # Jan - Dec
> $time->wday # Sun = 1, Sat = 6
> $time->day # Sun - Sat
Seriously?
Re: Not Your Grandfather’s Perl
#165Earlier quoted context omitted.
I would argue that ruby as almost all the strengths of perl and conciseness with more coherency if you want a perl-like fluidity and terseness. I personally like python for anything that becomes more than a 100 lines of bash.
Due to poor coding practices (eg monkeypatching) and a weaker testing culture (by default Ruby does not run unit tests when installing libraries) I've found Ruby to be substantially less reliable than Perl. However the world has moved on to Python. So I curse every time I again have to look up how subprocess works for what I'd do in Perl with backticks.
Re: Not Your Grandfather’s Perl
#166Earlier quoted context omitted.
"Perl makes easy things easy and hard things possible."
What we need from a programming language is to make medium complexity things, at worst, medium difficulty. I don’t care about hard problems, and easy problems.
But it's a very different niche. Perl and Ruby scale to mid sized applications quite well, but above that fault tolerance and QoS become hard.
Re: Not Your Grandfather’s Perl
#167Earlier quoted context omitted.
Kind of caught up. I don't think there's much like cpantesters and the strong emphasis on testing elsewhere.
Agreed, and the cpan shell too.
Re: Not Your Grandfather’s Perl
#168Perl receives such an unnecessary amount of hate
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.
Actually using the language itself is far less painful in Perl than it is in Python.
Re: Not Your Grandfather’s Perl
#169Earlier quoted context omitted.
Does Ruby come pre-installed on virtually every Unix-like system out there?
No, and if it is, who knows what version it is. I think that's the main thing preventing one from using ruby like this. It is otherwise preferable in pretty much every way. Perl is kind of pre-installed on virtually every Unix-like system for what are at this point historical/legacy reasons. It is unlikely any other language can ever achieve this at this point.
Sure, I could probably install Ruby on any machine I want it, but it's not just technical availability. Socially, Perl serves as a quite obvious Schelling point. I don't have to convince four other people to learn Ruby, because Perl is what everyone would gravitate to even in isolation, again because it's just... there.
(That said in recent years I've had to switch to Python for some things aimed at a younger audience. Oh well.)
Re: Not Your Grandfather’s Perl
#170Earlier quoted context omitted.
One of my criteria for good tools is that they scale well from the smallest possible use case to absolutely massive. Git meets this criterion for example. Anyway I manage a 250kline code base written over 20 years which is in surprisingly good shape consider it's age and how many people have touched it. Last time we upgraded the perl for the first time in a decade - going through the addition of many features and maj…
"Perl makes easy things easy and hard things possible."