Live data from Hacker News

Why Perl Didn't Win

outspeaking.com

81–90 of 157 posts

Re: Why Perl Didn't Win

#81

Earlier quoted context omitted.

This sort of distinction exists in other languages though: Java has == and equals. OCaml has = and == etc. (Not that Perl doesn't have its issues; but this is very low in that list imho)

But in those languages, the equivalent to ($x == "foo") will return false (almost) all of the time. The poster here says that this expression is true (almost) all of the time in Perl. Why?

Because if you disable warnings, it silently coerces 'foo' to 0.

This is why disciplined (i.e. non-tiny-script-y) perl code starts off with

    use strict;
    use warnings;
just like disciplined javascript starts off with

    /* use strict */
and disciplined C code enables compiler warnings, and truly disciplined C code makes those fatal, just like in perl you can do

    use warnings FATAL => 'all';
If you don't do that, then you get the short script/one liner style behaviour where, just like sed, awk or bash, it assumes you know what you're doing. If you don't, then you should be asking the VM to help tell you when those problems exist, same as 'set -x' in bash is incredibly useful if you don't plan to add '|| exit 255;' onto the end of every command.

Re: Why Perl Didn't Win

#82
post #7

Maintenance. I say this as somebody who loves Perl, quirks and all (actually because of the quirks). It's actually a beautiful language to work in in the same way English is a beautiful language -- it's a beauty because it's a goddamn mess. But it's a rotten language to maintain. Sure, it's perfectly possible to write highly maintainable code (I have a few 30-40k line Perl projects that I can open up and get right to…

I don't want the popularity we once had.

The same people who wrote unreadable, unmaintainable perl went on to do the same sort of damage in PHP, then python, then ruby/rails, and now node.js/go. They were never a net positive to the community, and I'm not sorry to see them causing problems for somebody else.

(and before somebody says "but that doesn't happen in X" ... yes, it does, even python lets you write code that looks superficially comprehensible but turns out to be so horribly illogical structurally that it's impossible to maintain - I quite like python but I've been there and I was kinda scared because at least wrong perl looks wrong to start with, whereas wrong python looks fine until you realise just how much of a crawling horror it is)

Re: Why Perl Didn't Win

#83

I was a Perl scripter (I never rose to the level of JAPH) from around 1998 to 2002, with my final accomplishment being a two-way HRIS synchronization system between our installation of peoplesoft and our LDAP server (Netscape LDAP server, awesome product). And then I met Python, and I never wrote another line of Perl, and have written some python code almost every week since then. There were two personal reasons why…

I felt much the same way, except in reverse - perl data structures did exactly what I meant, python data structures didn't.

I don't think this is a compliment or complaint about either, just a question of different people thinking different way.

Re: Why Perl Didn't Win

#84
post #60
post #57

Earlier quoted context omitted.

So maybe winning is more like winning for a time period. PERL did win. It won up until early 2000s, then lost. I am guessing it is not getting picked much for new, greenfield projects. I think that is a cut-off metric. One way get there is to find a niche. Maybe it isn't the new use-for-everything language. But at least can become the "ok, use for this one area" language. C -- still winning in that respect. It is use…

I think the definition of 'winning' people use around here is, if start ups think its a trendy technology to use. So you will see all these new companies stop using a particular language, and then when some conference happens you will see talks around the older technologies have dried out, while people are giving talks on the newer set of technologies. Its then when you see articles/rants/blog posts on the lines 'Wha…

Can you fix the bug in "$current_years - 5 years back", please - it's bothering me. If you're going to talk in code, at least get it right ;-)

Re: Why Perl Didn't Win

#85
post #7

Maintenance. I say this as somebody who loves Perl, quirks and all (actually because of the quirks). It's actually a beautiful language to work in in the same way English is a beautiful language -- it's a beauty because it's a goddamn mess. But it's a rotten language to maintain. Sure, it's perfectly possible to write highly maintainable code (I have a few 30-40k line Perl projects that I can open up and get right to…

> But it's a rotten language to maintain. I've been diving into some of our legacy Perl and man, the learning curve of the various sigils and implicit variables. Even working with collections was challenging. I'm working to make it better Perl (I have a copy of Modern Perl on my desk), but that's solely to make it understandable so that we can rewrite it / replace it with something like Salt.

If it's seriously legacy code ... then I'd completely support you rewriting it, and I'd rather see it rewritten as not-perl than left as bad perl, no matter how much I personally do like perl.

This is why I'm glad we're not the 'most popular thing' anymore, these days the same quality of people are producing similarly awful code in node.js and go, and I feel sorry for those languages' communities because of it.

Re: Why Perl Didn't Win

#86

I gave up on perl when I saw the following code: $x = $src[$src]; I was confused as hell until I realized that arrays and scalars had different namespaces. That, along with the fact that "or" and || had different precedences were what ended Perl for me. I'm not saying that wonderful code can't be written by Perl, it just wasn't the right language for me in that I hate memorizing one-off rules, which Perl seemed to ha…

IIRC, 'or' and || have different precedences in other languages, too - PHP, for example.

Re: Why Perl Didn't Win

#87

How does a language win? By being compelling enough to be used for new things. It's not solely a technical concern; it's a concern of the language community and ecosystem. One of the most valuable 4 sentence paragraphs I've read from an HN post in awhile. (Perhaps 3, but the semicolon really separates 2 sentences.)

The semicolon separates two independent clauses, but they constitute a single sentence.

When we're thinking about language, clauses are probably a better atomic unit than sentences; clauses are a semantic unit, and sentences are really just a syntactic packaging format for some number of clauses. Just like we should be counting expressions (or something) rather than lines of code.

Re: Why Perl Didn't Win

#88

I gave up on perl when I saw the following code: $x = $src[$src]; I was confused as hell until I realized that arrays and scalars had different namespaces. That, along with the fact that "or" and || had different precedences were what ended Perl for me. I'm not saying that wonderful code can't be written by Perl, it just wasn't the right language for me in that I hate memorizing one-off rules, which Perl seemed to ha…

If you only want a single namespace for everything, I recommend sticking to only scheme (note: I really love scheme for that property, I'm not being sarcastic).

Once you learn -enough- perl, there's a sort of overall consistency that's actually really nice, but there's a gap ... simple perl is very simple, but mid-level perl is generally a mess until you get to the expert level, and then its awesome again.

There's probably an analogy to text editors here.

Re: Why Perl Didn't Win

#89

Earlier quoted context omitted.

Your reply makes no sense to me I'm afraid. > And I didn't realize the well written Perl code compiles equally better. Equally better? > And its certainly a lot easier to open files and do things in Perl than writing several hundreds of lines just to set and get variables for one single class. Come on, seriously. Here's how I open files in Java: import com.google.common.io.Files; List lines = Files.readLines(new File…

On the one hand, that's a pretty cool library. (with a function to emulate back-tick into an array) On the other hand, now I have to go to the Enterprise Committee with a Permission To Install Library Form to get it, since it's not part of the base language. It might well be worth it to use Google's jar, but it's a delaying nuisance.

java 8 has

http://docs.oracle.com/javase/8/docs/api/java/nio/file/Files...

Stream Files.lines("/foo", StandardCharsets.UTF_8)

java 7 has http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files... but it's not lazy.

Re: Why Perl Didn't Win

#90

I have two programming tattoos: a Perl camel and a Ruby ruby. That basically tells the story of why Perl didn't win for me: As soon as I started learning Ruby, I thought, "Oh, a cleaned-up Perl" and never really wrote any Perl code again. I love Perl's personality, its quirkiness, and its massive amount of libraries. Perl was _massively_ influential on me as a young programmer. But I'm pretty sure that I won't be wri…

ruby is awesome until I want OO ... then I get about an hour in and find that I've got to write 5x as much boilerplate as I would under Moose/Moo, and there's no proper trait/role system, and then I get annoyed and go back to perl.

If ruby had OO as good as Moose, I'd seriously consider switching. Sadly the projects to port Moose to ruby never seem to get finished.

Post reply on HN