Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Migrating from Perl to other language? Why would someone do that?

by Laurent_R (Canon)
on Nov 24, 2013 at 00:18 UTC ( #1064090=note: print w/replies, xml ) Need Help??

in reply to Migrating from Perl to other language? Why would someone do that?

Just my personal experience: I moved away from Python to Perl about 11 years ago.

The first dynamic language I used in the late 1990s was TCL; I did not like its syntax too much, but I found it great because of TK. Then, in 1999 or 2000, I discovered Python. I found its syntax far better than TCL: to me, TCL was really more like a scripting language, Python a real programming language (please don't flame me if you disagree, I am not claiming to be telling the truth about these two languages, I am only talking about my personal impression on them). And I loved Python at the time. And I can distinctly remember having seen a lot of articles in the Python circles disparaging Perl as a baroque language, almost impossible to learn, or requiring about ten books to start mastering just the basics. So I was very happy that I had chosen Python and not Perl, even though it had been by coincidence, not by carefully reasoned choice.

Then, my job changed in 2002 (same company, but different team and assignment and different work) and discovered that the data migration suite that I was going to have to use and possibly upgrade was written mainly (probably 85 to 90%) in Perl, with some C for highly time-sensitive programs, some shell, SQL loader, and a few other technologies. I was a bit frightened because of the terrible reputation the Python people has instilled into my mind about Perl. Although I was working in an implementation team rather than a development team at the time, I felt that I needed to learn some Perl, at least for understanding the tools that I would have to use. I picked up a 70-page tutorial on Perl on the Internet, read it and made small test programs within two or three days, and found it quite easy.

And it just happened that something in our migration process did not work as expected. Some data needed some intermediate reformatting for the migration suite to work properly. No problem, I first thought, I'll write a quick Python within one day or so, and that will solve our issue. Then, on a second thought, I decided I might try as well to do it in Perl, that I had just started to learn. I did it over the weekend, because I did not think it would be fair toward my company to try to write a program in a new language on my working hours. I actually finished it on the Saturday (well, completed it late Saturday evening or perhaps even in the early hours of Sunday). In brief, after having spent two days on a tutorial, I was able to write a real Perl program for professional purposes within one day, more or less the time that I was thinking necessary to do it in a language that I had been practicing for 2 to 3 years. I was probably helped a lot by the DWIM principle. My first real Perl program was obviously clunky and clumsy, and obviously written in "baby Perl", but it worked, it did what was needed, and it did it very quickly. I haven't kept a copy of that program, I would probably be appalled by its coding quality if I were to review its code today, but, again, it did the job, and that only mattered.

That experience told me two things: 1. that Perl was not that baroque and that complicated, far from that, and it was actually easy to use (even if I was obviously using a small subset of it at the time), and 2. that the Python pundits that I has read about Perl did not know what they were taking about or were just not telling the truth.

The outcome of this experience is that I have never written a new Python program since (OK, I updated a couple of older ones). And i would not be able to write a Python program today without starting everything from scratch or almost.

A couple of more thoughts. As I said, I loved the Python syntax at the time and I don't think I would change my mind today, I still think it is an efficient programming language. I still think, as far as I can remember, that it is very clean and straight forward. But Python is probably insisting too much on object-orientation in my view. Sometimes, the functional programming paradigm works much better. Perl offers both OO programming and functional programming (and even other programming paradigms), it is up to you to choose. Python has only one programming paradigm.

The mind set is different. Perl's "theological" principle if that "there is more that one way to do it", "do it as you wish so long as it works", which is an open-minded view, Python's viewpoint is just the opposite: "You are wrong and should be burnt at the stake if you don't do it the way I decided." (Hum, agreed, I am exaggerating a bit here, but that's the idea.) But the point is that when you agree that it can be done in different ways, you must also agree that it can be done in a different languages, whereas if you think there is only one way to do it, you may quickly become a fundamentalist or a fanatic that thinks that the only way to do it is in the language of your choice.

One final point: I am using servers with numerous OSes: HP-UX, AIX, Solaris, various brands of Linux, etc. Every single platform that I am using has Perl built in, Actually, Perl is even used by the OS for some tasks. Most of them don't have Python. Python is not installed in most cases (well, it is there on one Linux platform). Which one is really mainstream?

  • Comment on Re: Migrating from Perl to other language? Why would someone do that?

Replies are listed 'Best First'.
Re^2: Migrating from Perl to other language? Why would someone do that?
by LanX (Saint) on Nov 24, 2013 at 00:50 UTC
    Laurent_R++ :)

    Great post, thank you!

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Re^2: Migrating from Perl to other language? Why would someone do that?
by taint (Chaplain) on Nov 24, 2013 at 19:41 UTC
    An excellent retrospect, Laurent_R. Well done.

    Thanks for taking the time to share it with us! ++.


    #!/usr/bin/perl -Tw
    use Perl::Always or die;
    my $perl_version = (5.12.5);
    print $perl_version;

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1064090]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2023-09-24 17:46 GMT
Find Nodes?
    Voting Booth?

    No recent polls found