Stories
Slash Boxes
Comments

SoylentNews is people

posted by janrinok on Thursday September 19 2019, @03:09PM   Printer-friendly
from the perl-one-liners dept.

Back in May, writer Jun Wu told in her blog how Perl excels at text manipulation. She often uses it to tidy data sets, a necessity as data is often collected with variations and cleaning it up before use is a necessity. She goes through many one-liners which help make that easy.

Having old reliables is my key to success. Ever since I learned Perl during the dot com bubble, I knew that I was forever beholden to its powers to transform.

You heard me. Freedom is the word here with Perl.

When I'm coding freely at home on my fun data science project, I rely on it to clean up my data.

In the real world, data is often collected with loads of variations. Unless you are using someone's "clean" dataset, you better learn to clean that data real fast.


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 September 19 2019, @08:44PM (7 children)

    by Anonymous Coward on Thursday September 19 2019, @08:44PM (#896247)

    Devops was done in Perl before Python was a thing.

    Python does not handle inheritance loops automatically, Perl does. Polymorphism in Python is an intolerable mess. It is easy as cheese in Perl. These two things are the whole reason you use OO. Sorry but there it is. Perl has better OO than Python does.

    Perl was free and well documented and not OO a long time ago, and so a lot of people learned on it and released wickedly evil code into the wild. So you've got this really bad non-OO code on sites like hotscripts and you look at in and go Eeeew! But if you write Perl in OO it is quite clean and fast and easy to maintain and it has been for more than a decade now.

    The problem with Perl is that badly written code works. The great thing about Perl is that badly written code works.

    There are some distro maintainers in the Linux world that seem to hate on Perl. Debians default Perl distro was busted for years. Probably still is. I guess there are some guys over there that like Python, though they also like SystemD, so there is no accounting for taste.

    Incidentally SN is written in Perl. It is based on slash, which is FOSS. I've looked at the source for slash. Eeeeew! But it has lasted decades on now, so there you go.

    Python looks clean when you first see it. But then you discover that there is no such thing as an undef in Python, and that all the builtin types do not have compatible existence tests. Then you discover that every object is actually two objects (the class itself is a separate object with distinct isolated functions) and that there are methods to handle inheritance instead of doing it implicitly at constructor time. And then you have all the invented words in the documentation that try to explain that all the non-OO-isms are a feature, instead of just saying Python has some bad internal architecture, and this is how we worked around it to give a sortof OO environment.

    I'm sorry but the Python zealots are fucking irritating. "Everything is an object!" Then why the fuck do you Python guys NEVER use multiple inheritance? Oh, and Pythons maintainer has abandoned the project. Maybe he discovered Perl?

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

    Total Score:   4  
  • (Score: 1, Touché) by Anonymous Coward on Thursday September 19 2019, @09:07PM (1 child)

    by Anonymous Coward on Thursday September 19 2019, @09:07PM (#896258)

    Lots and lots of automation, admin, monitoring tools, interface code and a raft of other stuff was done in Perl before devops was a thing.

    Just sayin'

    • (Score: 0) by Anonymous Coward on Thursday September 19 2019, @09:22PM

      by Anonymous Coward on Thursday September 19 2019, @09:22PM (#896263)

      Larry Wall was Moses in a previous life. Everything was written in Perl at some point.

  • (Score: 5, Interesting) by legont on Friday September 20 2019, @01:22AM

    by legont (4179) on Friday September 20 2019, @01:22AM (#896334)

    From what I see the biggest problem with Perl is that it just works. I have mission critical half a million lines of code that was not maintained since developers were fired in 2008 crash and it still works. Nobody at the office realizes the miracle because the thing works and does not bother anybody with outages. The result? We lost Perl in-house expertise.

    Java shit was broken numerous times during this time and management had to invest in Java developers, hire them, train them, budget total rewrites multiple times. Hence, there are now thousands of java "experts" in the office and they have to be because otherwise it would simply die. Meantime only a few Perl ones remain and there is not enough man power to upgrade the code for the new environment by two orders of magnitude. They actually want me to rewrite mentioned 500,000 lines of code with help of two off-shores, while it was originally developed by a dozen of guys each one smarter than I.

    Kids, if you are reading it, make sure your product breaks often. Don't repeat our mistake. Never develop maintenance free one.

    --
    "Wealth is the relentless enemy of understanding" - John Kenneth Galbraith.
  • (Score: 0) by Anonymous Coward on Friday September 20 2019, @03:14AM (1 child)

    by Anonymous Coward on Friday September 20 2019, @03:14AM (#896365)

    "Sorry but there it is. Perl has better OO than Python does."

    Perl 5's OO is surreal. You used to have to roll your own objects via 'bless', but now libraries abound for all kinds of crazy object systems. Sounds like a nightmare, but they all work together. If that's not having your cake and eating it too, I don't know what is.

    • (Score: 3, Insightful) by The Mighty Buzzard on Friday September 20 2019, @03:32AM

      by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Friday September 20 2019, @03:32AM (#896374) Homepage Journal

      If that's not having your cake and eating it too, I don't know what is.

      I'm on keto, you insensitive clod!

      Okay, not really. Any diet that doesn't mandate biscuits and gravy regularly can fuck right off.

      --
      My rights don't end where your fear begins.
  • (Score: 0) by Anonymous Coward on Friday September 20 2019, @04:55AM (1 child)

    by Anonymous Coward on Friday September 20 2019, @04:55AM (#896396)

    Somewhere during the late 1990's I got a nice compliment from someone with the relevant experience for making it: my Perl code was among the cleanest and best structured he'd ever seen.

    Nowadays I strongly prefer Python. Why? Because it's cleaner in my perception. I remember reading somewhere that Larry Wall basically wrote Perl to fit his own way of thinking. Python is a better fit for my way of thinking. To me that means that one language probably isn't objectively better than the other, they are simply optimized for different brain types.

    The way you write about Python suggests you look at it as if it's a different kind of Perl that doesn't behave the way Perl should behave. It isn't, it's a different programming language, not a different Perl. Someone who looks at Perl expecting it to be like Python will have similar criticism and be just as wrong.

    I'm not asking you to like Python, I'm perfectly happy if you don't. I'm just pointing out that you're looking at it from a specific perspective which isn't necessarily superior to other perspectives. It's just a preference. You're complaining about Python zealots but your perspective seems to have similar limitations, at least in this post.

    • (Score: 1, Interesting) by Anonymous Coward on Friday September 20 2019, @03:20PM

      by Anonymous Coward on Friday September 20 2019, @03:20PM (#896525)

      I've used Perl Python Ruby and Java, and Python. Python looks clean. But the top down constraints built into it make it bloody murder to refactor. If you code yourself into a corner in Python you have to refactor from the top down. If you code yourself into a corner in Perl, you can can cut the other end off the toothpaste tube. It isn't pretty and you shouldn't do it that way, but you can in a pinch.

      In Perl you can pay now or pay later. In Python you pay up front and hope to god you didn't make any mistakes in the initial design. Because it does not tolerate design mistakes. This means that you have to have somebody who really understands software design well to make Python scale. And if they understood it that well, chances are they wouldn't have picked Python.