4 ms·
Perl rose to popularity because early web development was all about text processing (reading web forms and outputting HTML) and Perl made that easier (regex del
by snorkel 4y ago
Perl rose to popularity because early web development was all about text processing (reading web forms and outputting HTML) and Perl made that easier (regex deluxe) than other choices on unix at the time. It became the lingua franca of web developers. Perl 5 made heavy use of symbols so it was visually noisy, and then Perl 6 came along and added even more magic meanings to other symbols, and that was a tipping point of perl’s decline. Readability of code is paramount. Code is for machines to execute and for humans to understand. Perl code became both modernist abstract art, and Baroque in its intricacies.
- anthk 4y agoWhat? Perl it's far more than a regex machine looking like line noise. If you think that about Perl, you'll get mad with AWK. To me Perl it's a better tool for anything better than shell scripting without needing to get dirty with C or Go.
- tootie 4y agoAs someone who spent many years loving Perl, I counter that literally every programming language is obtuse and overloaded with meaningless symbols. And I'd also credit Perl's rise to Lincoln Stein who wrote CGI.pm which was at the time the absolute state of the art for managing web applications with Apache and mod_cgi.
- mistrial9 4y agoyes and, one of Perl's design goals was literally "report generation" .. which it turns out, might be in HTML format
- hedora 4y agoIt can't do reports. It's a rubbish lister. It's also clearly not an anagram of REPL. I wonder if anyone ever figured out how to write REPL with a keyboard. I'd like to learn it some day. (REPL was written in a crazy character set and relied on custom printed punch cards. I think it was the perl of its day.)
- bmn__ 4y agoCGI.pm is a port of Perl 4 cgi-lib.pl. Credit: http://cgi-lib.berkeley.edu/#credit http://cgi-lib.berkeley.edu/#credit
- daneel_w 4y ago> Readability of code is paramount. For almost all languages, Perl included, this onus is mainly on the programmer. You can churn out gritty spaghetti in almost any language. Perl code doesn't have to look like what Perl programmers put out in the 90s. It's an old misconception that people refuse to let go of.
- snorkel 4y agoTrue you can write readable Perl code, but developers tend to adopt the predominant style of the community of each language, and the community was showcasing more brevity and cleverness than clarity
- TremendousJudge 4y ago>You can churn out gritty spaghetti in almost any language But some languages make this much easier than others
- daneel_w 4y agoThat should not be misconstrued as Perl making it hard to write clean code. It does not. It swings both ways.
- ninkendo 4y ago> You can churn out gritty spaghetti in almost any language. I hate this argument because it doesn't allow for any variation in the intrinsic readability of languages, or the style those languages encourage. Yes, you can write shitty code in any languages, but some languages encourage it, while other languages discourage it. I would say that Perl encourages unreadableness more than any of its peer languages, and the corpus of actual code out there is much more likely to be terse, unreadable noise than what you're likely to find in most python or ruby projects.
- daneel_w 4y ago> "I hate this argument because it doesn't allow for any variation in the intrinsic readability of languages, or the style those languages encourage" I don't understand what you mean by this. How ever does that argument mute Perl's dynamic expressiveness - which lends equally to unreadable syntax as much as clean syntax - or the commonly encouraged patterns in Python? > "and the corpus of actual code out there is much more likely to be terse, unreadable noise than what you're likely to find in most python or ruby projects" Because Perl saw in its infancy back in the 90s much higher use than Python and Ruby did. It's the same with PHP, which looked like shit in the 90s even if it didn't need to. Incidentally, PHP, too, suffers from stubbornly outdated criticism. I think you're too hung-up on the languages themselves, and forgetting that programmers, and software development and engineering as a process and as an art, evolved a lot the past 20 years - much has happened also with how people write C today compared to the 80s and 90s.
- cafard 4y agoI first encountered Perl as Perl 4, which certainly had the @ and $ sigils. I had been using Perl 5 for a while before using it in any web development. I think that Perl 6 contributed to Perl's decline much more by the long delay and certainly than by anything it had when it appeared. Edit: and Perl 4 had the % sigil.
- peelle 4y agoIf I understand right you are saying that the # of symbols Perl employs makes it hard to understand or read, correct? TL;DR; I would say that you assertion is context sensitive. - For a junior Perl programmer or an outside expert those symbols are stumbling blocks. - For an intermediate Perl programmer and up, those symbols are tools that make the code more readable and expressive. I got two ways of looking at that. First, I would look at Perl in the context of language. It is a more context sensitive language than some of it's close competitors. When you understand those \ $ % @ & sigils you gain the ability to know at a glance the context in which data is being used. Understanding @_, $_, allows you to write shorter code without sacrificing meaning. Part of the Perl philosophy is TIMTOWTDI. Most of those special variables also have an English equivalent. Instead of using $) which I never remember I can use $EGID, or if I think that's not explicit enough then I can use $EFFECTIVE_GROUP_ID to really spell it out. The second way is that Perl has a steeper learning curve than it's close competitors. I see this like comparing Vim to Notepad++ and Emacs, or Haskell to well most other functional programming languages. Just because it took longer to learn, that doesn't mean it's better or worse at creating good code. It does mean that armchair pundits are less likely to be correct in their hot takes. They lack experience and understanding.
- G3rn0ti 4y agoWhile ultimately everything is a matter of taste, the kind of people that hate sigils also tend to hate parentheses in Lisp. Both syntax elements are there for a reason. I believe sigils make string interpolations easy to support in a language. Consider JS that had to introduce an adhoc „${}“ expression to support those eventually.
- marttt 4y agoAn excellent heuristic proposed e.g. in the book "Modern Perl" (2015) [1] is to think of $_ as the pronoun it in human language, and @_ as the pronouns they/them. Edit: a previous HN comment thread on how sigils are derived from practical linguistics: https://news.ycombinator.com/item?id=26659322 https://news.ycombinator.com/item?id=26659322 1: https://pragprog.com/titles/swperl/modern-perl-fourth-edition/ https://pragprog.com/titles/swperl/modern-perl-fourth-editio...
- 4y ago
- scelerat 4y agoI feel like PHP was the first big blow to Perl's king-of-the-web status. Python and especially Ruby+Rails knocked Perl off many people's radars for good.