5 ms·
I used Perl on and off for decades. It was fine. It seemed that Perl allowed me to leverage my existing knowledge of UNIX utilities, regular expressions, etc.
by jes 6y ago
I used Perl on and off for decades. It was fine.
It seemed that Perl allowed me to leverage my existing knowledge of UNIX utilities, regular expressions, etc. So using it wasn't completely like learning a new programming language and a set of libraries at the same time. In other words, the startup cost wasn't all that high.
I agree with comments about doing anything too complex with data structures in Perl. I am sure there are people that easily remember the syntax for returning a reference to a hash of hashes, or whatever. I'm not one of them. Every time I have to work on applications I wrote previously that did this, it's a couple of hours of googling and trying things out in the interpreter.
If I had to write or rewrite a large application today, I'd probably use Python. I learned it fairly well about ten years ago and enjoyed working in the environment.
In my secret inner fantasy world, I'd use Common Lisp exclusively, my colleagues would just agree that it is the best programming language ever, and we'd spend our days sitting in an outside cafe in San Jose, drinking espressos, hacking our .emacs files "for efficiency," and telling stories about how we used to boot computers by first toggling in the boot loader from the front panel.
- fennecfoxen 6y ago> I am sure there are people that easily remember the syntax for returning a reference to a hash of hashes, or whatever. Ehhhhh. I appreciate the opaqueness of Perl, but you've described something like the easiest data structure in Perl to write and access: return {"foo" => {"bar" => "baz"}}; return {foo => {bar => "baz"}}; $data->{foo}{bar} = "quux"; etc etc. It's when you drop away from the land of hashrefs and listrefs, and have to use plain old hashes and lists, that things actually get super weird - because most programming languages you're used to simply give you "refs" for everything, and they definitely don't have concepts like "list context" that let you merge lists by saying @a = @b, @c;
- WesolyKubeczek 6y agoA wild Python suddenly appears: third_list = [*first_list, *second_list] You don't even need a "list context" for this!
- fennecfoxen 6y agoI agree. That's how normal languages do it. But Perl's "normal" is one level up, and 80% of data structure confusion in Perl comes from that.
- blacktriangle 6y agoI wonder if you've hit on a major factor of Perl's decline. Like you say much of Perl's power was leveraging existing unix utilities, the whole duck tape development thing. As more developers started growing up on windows and then macs, fewer developers had knowledge of the tools to tie together. Without the unix tools to tie together, perl's value proposition drops.
- jes 6y agoI think that may be part of it. For example, if grep (1) doesn't already mean something to a person, they probably won't have an immediate idea about what the grep function in Perl is all about.
- daotoad 6y agoI believe this is a major reason. Demographic shift. Perl grew to prominence when being a creole of C, shell, sed, awk, and lisp was an advantage. Anyone who might reasonably use it would be familiar with at least a few of these tools. Now, we live in a very different world. JavaScript is the new BASIC. Everyone has JsBASIC installed on their (virtual) machines. So that's what people learn on their own. Python and Java are closer to JS so, the transition is easier (at least superficially--I could argue that JS and Perl a lot in common, designwise).
- sea6ear 6y agoI think a related factor is the shift from raw text to databases. Perl's text oriented tools shine (obviously) when there is a lot of text to deal with. There was a lot of that at the dawn of the web. However, the rise of database backed web apps gradually removed a lot of the need for the special magic that Perl brought to the table.