Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 17 submissions in the queue.
posted by Fnord666 on Thursday October 12 2017, @01:07AM   Printer-friendly
from the There’s-more-than-one-way-to-do-it,-but-sometimes-consistency-is-not-a-bad-thing-either dept.

Ruth Holloway at Red Hat's marketing site, OpenSource.com, has a retrospective on three decades of perl covering some history and a few of the top user groups. The powerful and flexible scripting language perl turns 30 at the end of this year. It is a practical extraction and reporting language widely used even today and has a dedicated community. It's ease of use and power made it the go-to tool through the boom of the 90's and 00's when the WWW was growing exponentially. However, its flexible syntax, while often an advantage, also functions as a sort of Rorschach test. One that some programmers fail. Perhaps two of its main strengths are pattern matching and CPAN. The many, mature perl modules available from CPAN make it a first choice for many when needed to draft something quickly or deal with a quick task.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 4, Insightful) by Anonymous Coward on Thursday October 12 2017, @01:17AM (19 children)

    by Anonymous Coward on Thursday October 12 2017, @01:17AM (#580893)

    I used to know perl but consciously worked to forget it when I learned python.

    And why?

    Perl looks like line noise to me

    Starting Score:    0  points
    Moderation   +4  
       Insightful=4, Total=4
    Extra 'Insightful' Modifier   0  

    Total Score:   4  
  • (Score: 5, Funny) by The Mighty Buzzard on Thursday October 12 2017, @01:18AM

    by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Thursday October 12 2017, @01:18AM (#580894) Homepage Journal

    Odd, line noise looks like perl to me.

    --
    My rights don't end where your fear begins.
  • (Score: 2) by crafoo on Thursday October 12 2017, @02:09AM (8 children)

    by crafoo (6639) on Thursday October 12 2017, @02:09AM (#580919)

    I tried learning Perl quite a while ago. I can see where it would be very useful but some of the real-world examples I saw just took too much out of my brain to decode. Can't say I like Python all that much either but pysci and numpy are too awesome to ignore.

    • (Score: 4, Insightful) by The Mighty Buzzard on Thursday October 12 2017, @09:05AM (7 children)

      by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Thursday October 12 2017, @09:05AM (#581039) Homepage Journal

      The trick to learning any language is only learn the bits that are useful to you at the moment, then use them. It won't make you an expert overnight but it will make you a $language coder overnight. Expertise in perl, like in anything, only comes after lots of real-world use.

      --
      My rights don't end where your fear begins.
      • (Score: 1, Insightful) by Anonymous Coward on Thursday October 12 2017, @09:48AM (6 children)

        by Anonymous Coward on Thursday October 12 2017, @09:48AM (#581056)

        It's amazing how much better you'll be as a programmer if you just read the fucking manual from cover to cover.

        I did that with Perl many years ago, and found that after a week, I was indistinguishable from the experts in IRC channels, forums, and mailing lists, and I was even able to correct long-time users, and even make meaningful contributions to discussions about the evolution of the language.

        Of course, after dropping Perl, I quickly forgot it all, but the point remains: Taking a big gulp goes a long way toward allowing you to think in any particular language; small sips tend to make a you script kiddie who blindly copies/pastes from StackOverflow.

        • (Score: 2) by The Mighty Buzzard on Thursday October 12 2017, @10:25AM (2 children)

          by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Thursday October 12 2017, @10:25AM (#581068) Homepage Journal

          Nah. There's value in spending some RTFM time as well but if you think you haven't forgotten over half of what you just read over the course of reading a programming language manual, you're sadly mistaken.

          --
          My rights don't end where your fear begins.
          • (Score: 2) by Phoenix666 on Thursday October 12 2017, @11:03AM (1 child)

            by Phoenix666 (552) on Thursday October 12 2017, @11:03AM (#581080) Journal

            I find I have to RTFM more broadly every 4-5 years when an occasion arises to write more perl in bulk, because in between I mostly use it as a glue-/scripting language and there's a bit of a palimpsest effect that sets in after using other languages.

            --
            Washington DC delenda est.
        • (Score: 0) by Anonymous Coward on Thursday October 12 2017, @10:42AM (2 children)

          by Anonymous Coward on Thursday October 12 2017, @10:42AM (#581074)

          Small sips over a period of time allows you to make mistakes, learn, enjoy yourself and bed the knowledge in deeply. I can still work in C or Lisp having barely touched them for years.

          But sounds like reading a manual cover to cover allows you to be a know-it-all on IRC? If that's your thing, then go for it.

          • (Score: 0) by Anonymous Coward on Thursday October 12 2017, @02:14PM (1 child)

            by Anonymous Coward on Thursday October 12 2017, @02:14PM (#581133)

            It's not uncommon for an ass to be a know-it-all, but not every know-it-all is an ass.

            Only a fool scoffs at someone for knowing it all.

            • (Score: 0) by Anonymous Coward on Thursday October 12 2017, @03:35PM

              by Anonymous Coward on Thursday October 12 2017, @03:35PM (#581168)

              I scoff at your Pearl of wisdom.

  • (Score: 2) by http on Thursday October 12 2017, @02:57AM (8 children)

    by http (1920) on Thursday October 12 2017, @02:57AM (#580938)

    The complaint about perl looking like line noise has always looked like a bluff to me. Take these two (awful) sentences:

    They runs to store.

    He climb up red ladder.

    There's entire families of natural human languages which have definite and indefinite articles, and consider number agreement serious fucking business. English is one of them and you're using it.

    They run to the store.

    He climbs up a red ladder.

    Nobody complains about this "line noise" in human languages. Yeah, maybe you could drop them in some situations, but telling a listener "this is one of those situations where articles are not needed" requires more effort than just using the articles, and not only are you at risk of being misunderstood, you have to say when you're switching back. Count me out.

    --
    I browse at -1 when I have mod points. It's unsettling.
    • (Score: 5, Insightful) by Thexalon on Thursday October 12 2017, @04:22AM (7 children)

      by Thexalon (636) on Thursday October 12 2017, @04:22AM (#580973)

      Nobody complains about this "line noise" in human languages.

      That's not the complaint. The complaint is Perl that looks like this:

      @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
      @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
      ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
      close$_}%p;wait until$?;map{/^r/&&}%p;$_=$d[$q];sleep rand(2)if/\S/;print

      That makes it nearly indistinguishable from line noise. Yes, you can write incomprehensible gibberish in any language, but Perl makes it easier than many others, especially with all its regex-related features.

      --
      The only thing that stops a bad guy with a compiler is a good guy with a compiler.
      • (Score: 3, Informative) by Anonymous Coward on Thursday October 12 2017, @04:42AM (2 children)

        by Anonymous Coward on Thursday October 12 2017, @04:42AM (#580976)

        Perl makes it easy, as does C, Javascript, PHP and others. Note: this program is *deliberately* hard to read, not just golfed, so the comparison should be made against IOCCC, obfuscated Javascript and similar code.

        If you used maintained production code to make your point, we would have something to talk about. I'd probably show you a gargantuan unification error spat out by a C++ compiler to rejoin, but at least we'd be talking about real code.

        I'm sorry but your argument is either ill-considered or disingenuous.

        • (Score: 3, Insightful) by forkazoo on Thursday October 12 2017, @07:09AM

          by forkazoo (2561) on Thursday October 12 2017, @07:09AM (#581015)

          Perl's enthusiasm for things like regex as a first-class language feature tend to mean that a lot of ugly perl gets written. Compare that to a language like Python where readable use of whitespace is considered a first class language feature, and it's not shocking that Python tends to be more readable than Perl in practice. Sure, it's possible to write ugly code in any language. But Perl is a language where it tends to be easy to make things ugly.

        • (Score: 2) by canopic jug on Thursday October 12 2017, @07:53AM

          by canopic jug (3949) Subscriber Badge on Thursday October 12 2017, @07:53AM (#581024) Journal

          Indeed. Obfuscated code contests exist for many languages. So the comparison is not apt.

          Perl also makes it very easy to write simple to read code as well. Programmers should naturally, but often don't, gravitate to writing clear, easy to read code because code is read many more times than it is written. So the best cost reductions can come from reducing the burden of reading, especially when other people or the passage of time is involved and therefore programmers need to aim to write clearly. It takes both practice and will. One thing prevents that are the rush to just throw work over the fence and call it finished, same as in any other language. If the coding team, especially the boss, accepts or rewards hard to decipher work then that's what will be produced, regardless of language.

          Messy code can be overcome by a group decisions to do so. An example is what the OpenBSD developers do with their C code by enforcing style(9) [openbsd.org]. It is certainly in any team's self interest and even in programmer's own self-interest to strive to write clearly. Yet some don't. Thus the comment about the Rorschach test.

          --
          Money is not free speech. Elections should not be auctions.
      • (Score: 3, Insightful) by The Mighty Buzzard on Thursday October 12 2017, @09:17AM

        by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Thursday October 12 2017, @09:17AM (#581041) Homepage Journal

        Reading a highly optimized perl script is no more difficult than reading highly optimized C. You need mastery of the language rather than casual familiarity to do either. If you have that mastery, neither are difficult to read unless intentionally made so.

        --
        My rights don't end where your fear begins.
      • (Score: 2) by Phoenix666 on Thursday October 12 2017, @10:39AM (2 children)

        by Phoenix666 (552) on Thursday October 12 2017, @10:39AM (#581073) Journal

        Most code will look baffling if you run all the lines together like that. Vim has a great plug-in, perltidy, you should run.

        Beyond that it seems intelligible to me, once you understand regex's.

        --
        Washington DC delenda est.
        • (Score: 1, Funny) by Anonymous Coward on Thursday October 12 2017, @12:08PM (1 child)

          by Anonymous Coward on Thursday October 12 2017, @12:08PM (#581093)

          Most code will look baffling if you run all the lines together like that. Vim Emacs has a great plug-in...

          FTFY

          • (Score: 0) by Anonymous Coward on Thursday October 12 2017, @04:01PM

            by Anonymous Coward on Thursday October 12 2017, @04:01PM (#581188)

            No, Emacs doesn't have plugins. It has packages.