6 ms·
My boss came up with a good analogy to describe why some people like Perl and why some don't. There are some people who appreciate games that are very abstract
by muraiki 11y ago
My boss came up with a good analogy to describe why some people like Perl and why some don't. There are some people who appreciate games that are very abstract and with simple rules from which complex behavior emerges, such as a game like Go. These people tend to be drawn towards programming languages that are built out of small pieces with a consistent philosophy from the ground up, such as lisp or Haskell. There are others who enjoy games with complex rulesets and lots of detail. These people probably like Perl with all its nooks and crannies.
Perl code has many things to discover, and the way you assemble larger things relies on unique features of these smaller things. While in the end both approaches have you building a larger thing out of smaller things, the former approach is more likely to be built out of all of the same small thing, while the latter is more likely to be built out of a bunch of different small things. I think that's why some people can find Perl code to be "dense" and others find it "expressive".
I think Perl 6 was built with a much more consistent philosophy behind it than Perl 5, so this analogy breaks down a bit. But the user experience, the "Perlishness" of it, still remains. To the extent that people pick sides in language wars, I hope this analogy can help people appreciate the other side.
- baldfat 11y agoI started with Perl in the 1990s and well it was the only game in town for the things I needed to get done. Now as a semi-professional programmer (Temporary work and side jobs at work) I have learned to love Racket (Lisp Family), awk/sed and R. Since I only do this less then full time my brain can't hold everything in it for Perl or similar languages. I can sit down with a Lisp and just work it out with the parts I know and have to look up things far less.
- chucky_z 11y agoInteresting you mention awk. Do you use that professionally? For string manipulation I use almost exclusively pipe output to bash then format/grok with awk/sed, and wish that more (any?) languages implemented them fully!
- baldfat 11y agoI run several awk scripts to format csv files for my reports. awk is a great programming language but I use it for tiny 20 line scripts at most.
- jerf 11y agoI'd also suggest the purpose matters. What languages I like to use for my own personal work vs. what I want for professional work are quite different. Perl 6 may have a theoretically more consistent philosophy behind it than Perl 5, but as that philosophy would likely lead to even more complicated code than Perl 5 already does, I would live in fear of anyone at work adopting it for code I then have to maintain. Except that there doesn't seem to be any chance of that, precisely because everyone else around me feels the same way.
- muraiki 11y agoPeople make the same criticisms about Scala, but many people use Scala in production. My point is that we're talking about opinion here, not fact.
- Elrac 11y agoI hope it's permissible to contribute to an explicitly "opinion" subthread. Given that premise, here's my 2c: I'm not a lover of Scala, in fact I tried it and gave up on it because I didn't like its ratio of cleverness to simplicity (again, a personal opinion). But that said, and also being reasonably familiar with Perl, I would say that Scala is still much cleaner, more consistent, less idiosyncratic than Perl. I've seen some beautiful, expressive, masterful Perl code but I find that Perl really doesn't encourage me to write that way, while Scala works a bit harder to nudge you to write elegant code.
- raiph 11y agoMany things are simpler in Perl 6 than in Perl 5. My guess is you are thinking of the original Perl family.
- Elrac 11y agoAbsolutely! I hadn't looked at Perl 6 before the OP's presentation. But isn't Perl 6 a full superset of Perl 5? That would mean the full clutter is still underneath, and some people will continue to code Perl 5 in Perl 6.
- Estragon 11y ago> There are some people who appreciate games that are very abstract and with > simple rules from which complex behavior emerges, such as a game like Go. I love Go, but I despise perl. Perl is not built on "very abstract and simple rules. For instance, this code is quite hard to reason about: 1: my @to-infinity-and-beyond = 0, 2 … ∞; 2: say @to-infinity-and-beyond[1008]; # OUTPUT: # 2016 This is self-indulgent mucking around. An inference procedure which goes from "0, 2 … ∞" to "the even-nonnegative integers" is bound to lead to unpleasant and hard-to-debug surprises.
- deleted 11y ago[deleted]
- cnlwsu 11y agoThe next sentence says: > These people tend to be drawn towards programming languages that are built out of small pieces with a consistent philosophy from the ground up, such as lisp or Haskell. If you like go and dislike perl its to his point. A TLDR (because apparently); People who like games that are complex because of complex rules like perl. People who like complex games with simple rules dislike it.
- muraiki 11y agoWhat you consider "self-indulgent mucking around" others may call "declarative programming". I can appreciate that you don't like it, but I think you've missed my point.
- Ovid 11y agoI'm confused. What's so hard to reason about that? It's very obvious that it prints 2016. Maybe "infinite lazy lists" isn't something that most mainstream languages consider, but honestly, they're very handy and hardly "self-indulgent mucking about." (Though I'd probably use an asterisk instead of the infinity symbol)
- JadeNB 11y agoIndeed, if we're going to hold up Haskell as an exemplar of simplicity—which, in its philosophy if not always in its implementation, I think it is—then we can hardly ding Perl for including lazy lists!
- jonahx 11y agoI think this theory is too simple. For example, I find both well-written Perl and Haskell to be beautiful. It's a bit like saying some people only like minimalist writers and some people only like maximalist writers. But a discerning reader is interested in quality over the style. That is, they recognize that there is good maximalism and good minimalism, and appreciate both.
- adrusi 11y agoAnd that's true of reading, but notice that you refered to "minimalist writers" and "maximalist writers" rather than minimal and maximal works. Because most people do choose one over the other when creating rather than consuming.
- whitegrape 11y agoThe simple theory I use for explaining Perl preference is that it correlates to your preference and tolerance of postmodernism in general. http://www.wall.org/~larry/pm.html http://www.wall.org/~larry/pm.html is a good elaboration on the postmodernism of Perl, I think.
- chromatic 11y agoI disagree with the suggestion that Perl is not built with a consistent philosophy. That philosophy isn't "build from a minimal set of orthogonal features", but it's a coherent design philosophy: http://modernperlbooks.com/books/modern_perl_2016/01-perl-philosophy.html#VGhlUGVybFBoaWxvc29waHk http://modernperlbooks.com/books/modern_perl_2016/01-perl-ph... Many (but not all) of the questionable decisions in Perl come from its origins in Unix philosophy and the desire to provide a comfortable migration path for system administrators away from command-line tools such as awk and shell. Where Perl's struggled in recent years to borrow features from Rakudo, it's because those features assume a different underlying philosophy.