5 ms·
I'd also give it some credit as a cautionary tale. A lot of subsequent languages have focused on readability, partly as a reaction to some of the....unique thi
by mattkrause 7y ago
I'd also give it some credit as a cautionary tale.
A lot of subsequent languages have focused on readability, partly as a reaction to some of the....unique things came up with in Perl.
- goto11 7y agoYeah, the idea that programming languages should be more like human languages seemed promising at the time. Perl showed us that we definitely does not want that.
- tyingq 7y agoNot sure I understand that one. I know Larry Wall is a linguist. But there's not much about Perl, to me, that seems like a human language. If I dig into the gripes about the syntax, it's usually use of the implied $_ variable, wide use of sigils ($, @, %), derefs of complex data structures (hash of lists of hashes, etc) or regex syntax that people are talking about.
- ryl00 7y ago> derefs of complex data structures Am I the only one who finds perl data structures simple and consistent? Once I understood the difference between () and [] (or {} for hashes), it was easy (too easy, some might say!) to construct complex data structures.
- tyingq 7y agoCould partially be the TIMTOWTDI thing. People mixing: $foo->{bar}; $$foo{bar}; And quoting or not the key, etc. Slices and individual elements, etc. Probably looks like line noise to outsiders when you have a long one using parens to grab a specific array element, combined with $$ and so forth.
- WorldMaker 7y agoPlus many years of Bash script intended one-liners to replace or augment awk/sed leading a lot of Perl Golfers to a sublanguage that makes APL look far saner in comparison. That the code golf then shows up in "production scripts" and libraries (if for no other reason than muscle memory) builds a fortress wall to readability by outsiders.
- devurand 7y agoWhen I started to learn other languages after learning bash then Perl first, I was really dismayed at how clumsy it was to build up a data structure of any complexity. So verbose in the Java/C++/C# land. Having those constructs so effortlessly available with a minimal amount of syntax spoiled me. To this day, I would likely still prefer to do any kind of complicated ETL involving deeply nested structures with Perl.
- goto11 7y agoNatural Language Principles in Perl (by Larry Wall): http://www.wall.org/~larry/natural.html http://www.wall.org/~larry/natural.html
- kqr 7y agoThat is one of the things that are so brilliant about Perl. Tell a developer to create a programming language inspired by natural languages and you'll get verbose crap like COBOL which superficially looks "natural" but is very far from how languages work. Perl, on the other hand, looks just like a programming language would if it was the only way we could talk to computers, day in, day out: - Implicit "it" variable, - Very brief syntax for common operations, - More than one way to say things, - Context determines the meaning of things, and so on. It's not at all what one instinctively thinks of as "a programming language drawing from natural languages", but on closer inspection (and daily use) that's exactly what such a thing would look like!
- lizmat 7y agoFWIW, one of the reasons Perl 6 (now Raku) was started, was to fix the errors made in Perl, to be able to get an even more natural language. Even for difficult things: react { whenever signal(SIGINT) { say "Aborted"; done; } whenever Promise.in(3) { say "Timed Out" done; } } say "Goodbye"; This little program will wait for you to press Control-C or 3 seconds, whichever comes first. And say "Goodbye" on the way out.
- goto11 7y agoYeah, Wall knew what he was doing. He didn't try to make it look like a human language, he tried to make it work more like a human language. Another significant experiment in Perl was embracing the idea that everybody write in their own personal dialect or subset of the language. Again, the conclusion seem to be that this is a really bad idea since someone else will have to maintain the code eventually. But nevertheless it is valuable that the experiment have been tried. Python took some important lessons from that.
- coldpie 7y ago> That is one of the things that are so brilliant about Perl. > - More than one way to say things I respect that others may disagree, but I actually find this to be a major disadvantage in a programming language. From a readability perspective[1], having more than one way to express the same task is in my opinion a bad thing. As a trivial example, Perl supports both pre- and post-conditionals: if something then x = 1 or x = 1 if something which I find super cumbersome to parse. In all cases, I have to keep the whole phrase in mind before I can understand it, because I don't know which way the phrase will go. If there was only pre-conditionals, or only post-conditionals, then I would know how to parse each part of the phrase before I have read the entire phrase, which makes it easier to parse complex phrases. I think this is one major reason languages like Perl or C++ are often considered hard to read. Having so many ways to express the same thing means a major mental load until you've figured out what is trying to be expressed. [1] By now we've all come to agree that easy reading of code is far more important than easy writing of code, right?