Dive Deep Into Python Vs Perl Debate – What Should I Learn Python or Perl?

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Gunjit Khera

Currently a Computer Science student and a geek when it comes to Operating System and its concepts. Have 1+ years of experience in Linux and currently doing a research on its internals along with developing applications for Linux on python and C.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

29 Responses

  1. Dominix says:

    Python centric bullshit

  2. J Cleaver says:

    Some of these perl examples don’t really reflect what’s more-or-less standard in the Perl community at any time since Perl 5 came out (15 years ago).

    Keeping in mind the vision of TMTOWTDI, your second Perl example:

    open(FILE,”%lt;inp.txt”) or die “Can’t open file”;
    while() {
    print “$_”; }

    …really would be typically written as just:

    open (FILE, ”inp.txt”) or die “Can’t open file: $!”;
    print while ();

    As many others have pointed out, Perl has a huge amount of syntax flexibility despite its overtones of C heritage, and that allows people to write working code in a relatively ugly, inefficient, and/or hard-to-read manner, with syntax reflecting their experience with other languages.

    It’s not really a drawback that Perl is so expressive, but it does mean that the programmer should be as disciplined as the task warrants when writing it when it comes to understandable Perl idioms.

    • Gunjit Khera says:

      Thanks for Updating us with your knowledge and we would surely correct our code with the updated one as given by you.
      Stay Connected :-)

  3. David G. Miller says:

    1) I’ve usually found that the clarity and elegance of a program have a lot more to do with the programmer than the programming language. People who develop clean solutions will do so regardless of the language of implementation. Likewise, those who can’t program will find a way to force an ugly solution out of any language.

    2) Most systems administrators aren’t programmers and have rarely had any formal training in software development.

    Put these two observations together and you will still get ugly, “write only” programs Before perl it was shell script, yesterday it was perl, today it’s Python. Tomorrow someone will be asking for a replacement for Python because it’s so hard to read and can’t be maintained. Get used to it (but don’t blame the programming language).

    I started my perl programming with perl 2.0 in 1993. It’s still my “go to” programming language since it doesn’t get in my way and I can get to a solution much faster than with C or shell script.

    • Gunjit Khera says:

      You pointed out, that those who are programmers would find out clean and understandable solutions out of any language, while non-programmers would stay on getting ugly solutions out of any language. Its really on the experience of person and his familiarity with any language.
      Thanks for sharing your views with us. Stay Connected :-)

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 202,035
  2. 9,267
  3. 38,621

Are you subscribed?