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: 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.