ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm wondering what people's thoughts are about Python vs. Perl as a scripting language? I consider myself a quite good Perl programmer (self-taught and a lot of on-the-job experience) and I took a Python class at NYU.
Frankly, Python didn't really do anything for me. I'd rather code in Perl any day. What is the attraction so many have to Python? It's a bit stricter and therefore easier to debug, but that's my only thought...
Yeah, python would be ok if not for the whitespace problems. For me, that stops me from enjoying it enough to use it. I really appreciate the flexibility of perl and, of course, the scope of what's in CPAN.
I'm interested in learning Perl, but I really don't know where to begin. Perl 5 ? Perl 6 ? Not sure.
Otherwise, Perl is probably quite good.
I personally find Python a little bit overkill for many tasks, and fall back on BASH for system tasks that I want to script. It may or may not be as fast, but sometimes it just makes more sense.
I'm interested in learning Perl, but I really don't know where to begin. Perl 5 ? Perl 6 ? Not sure.
Perl 5 and Perl 6 are actually different languages. If you're looking just to get started, I'd say Perl 5 and focus on perl regular expressions. That's what it's best at and those are the most useful and are going to be mostly portable anyway as nearly all languages now have 'PCRE' either as modules or built-in.
I think the one thing I really HATED about Python was its reliance on whitespace for blocks of code instead of the usual braces or BEGIN and END.
I thought this at first, having been programming for nigh on 30 years before I met Python, but have now come to enjoy the way Python is laid out. Much simpler and cleaner to my eyes. Each to his/her own.
I have experience working with perl and python and I would say that I will never use perl on a project, and if I found perl code I will rewrite to python
I have experience working with perl and python and I would say that I will never use perl on a project, and if I found perl code I will rewrite to python
Any particular reason why?
My only "issue" with Python is its lack of scope. I really wish Py3k had introduced at least the *option* to use scope delimiters. I don't care how pretty Python code is, after a few levels of indentation, it gets confusing to figure out what parents what.
My only "issue" with Python is its lack of scope. I really wish Py3k had introduced at least the *option* to use scope delimiters. I don't care how pretty Python code is, after a few levels of indentation, it gets confusing to figure out what parents what.
The main reason is that I find hard to read the code. I remember that we got a script of 300.000 lines of perl and was a pain and nobody wanted to touch it. Another reason to not use perl is that if you want to mix with other libs I found more useful libs under python and if you need to mix with c or c++ is easy than in perl.
The languages are subtly different – indentation aside.
It's clear that Python's designer was familiar with LISP. There is a lot of list-processing mojo built into it.
Likewise, Perl shows an unmistakable influence of awk, which it was (in one sense) "built to replace."
Functionally, both languages are efficient ... well, except for Perl-6, which decidedly isn't ... and are well-supported by contributed libraries.
The contributed libraries are really "what the fuss is about." Many applications are constructed by piecing together objects and subsystems which are built and maintained by other people. (So you can "write a complete HTTP server using one line of code," for instance.) Perl, in particular, will not only install a package but rigorously test it on your machine before making it available for your use.
I simply believe that you should make it your business to familiarize yourself with present and emerging languages – because, well, "it is 'your business!'" (Programming languages happen to be a special interest of mine.) You can fully expect to encounter a wide variety of programming languages in use, simultaneously, at any "shop" you might work for or set up. At some point when beginning a new project you'll make the "fateful decision" of which language to use. (And every programmer who follows you will throw darts at your picture on their wall.) But, most of the time, there is no meaningful "versus." You'll continue the project in whatever language was originally picked – most of the time. (However, sometimes several tools are used in the context of a single project, both client-side and server-side. It can get nasty.)
Last edited by sundialsvcs; 04-26-2017 at 08:38 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.