Perl or Python ?
Whats its best to learn, Pear or Python ?
|
This topic is subjective and argumentative. The only solution to your problem, is to learn both and then find the one best suited for yourself.
|
Quote:
Python is deliberately more terse, requires a specific type of indentation, and has no way of indicating the end of a function. If you want ultimate flexibility at the cost of having to spend more time choosing which method you want to use to solve a problem, use Perl. If you are more interested in solving problems quickly and don't mind being forced to write your code in a specific style, use Python. |
The difference is that Perl has in it much more from functional programming paradigm ( http://en.wikipedia.org/wiki/Functional_programming ). Python is slowly catching up (i.e. Python 3.* vs Python 2.*).
I find the functional features quite convenient. This may sound odd, but in order to appreciate Perl read on Higher Order Perl: http://hop.perl.plover.com/ . |
I'm learning both. I'd like to say "know", but as it is, there's so very much I don't master yet (in both languages) even though I do get results and have built up scripts/programs that are hundreds of lines long. The thing is, neither was very difficult to learn and neither took long to learn to use. Pros: I can now work with either of them, depending on which one I have available or want to use or suits better for the given situation. Cons: knowing only one would probably have been sufficient, so I've "thrown away" some time by learning both. Not a con really.
In short, learn both of them. You're not going to lose anything. Instead if you only learn either one, but not both, you very probably will be haunted by the thought "was this really the best choice?" for the rest of your life, or up to the point where you do learn the other as well. Next question you're going to ask is "should I learn Python 2 or Python 3, or Perl 5 or Perl 6?". Answer: all of them :) |
Quote:
And the main developer wrote that strict typing, when used, makes the code slower though conceptually it should enable faster code. So, my intent to learn OCaml instead of Perl 6 steadily grows; Perl 5 is still my favorite language at the moment. |
Quote:
of statements and expressions. As with natural languages (English, Greek, Persian, etc), it is much harder to learn to speak and write the language than it is to hear and read that same language. As you read, you'll find that either Perl or Python suits your personal style. Cheers, ~~~ 0;-Dan |
Quote:
Quote:
|
Quote:
|
I am in the learn as much as you can group, although as pointed out in earlier posts this can make it difficult to become a guru in any language
quickly. I agree with Dan's post too that most languages use a commonish ground work (not trying to start a flame here) so to this end you can also look at it that if you become accomplished in one language it will generally be less of an arduous task to learn another. |
Quote:
What can Ruby do Perl can't ? I mean not only built-in functions, but things like closures, anonymity, scoping rules and the like. ... I've been looking closely at Perl6 because I want a language which allows both loose and strict typing - Perl6 allows. It looks like I'll look for strict typing in OCaml, and will still be using Perl5 for loosely typed programs. |
Quote:
|
Quote:
An example out of the many, see this FAQ for Perl to count substrings. True to Perl's mantra, there are a few ways to do it as stated in the FAQ. With Python, there is only one obvious way (note the word obvious), Code:
>>> string = "ThisXlineXhasXsomeXx'sXinXit" Code:
open FILE, '<', "foo.txt" or die "Can't open: $!"; Code:
open('foo.txt') you really have no reason to argue with me on this point of "more than one ways in Perl vs that in Python", if you have used Python long enough as you had used Perl. |
Quote:
So, conceptually there is a 'split' way to split a string and a regular expression way to split a string - both way are present in both langauges. So, as I said, there is more than one way to do it. |
Quote:
|
All times are GMT -5. The time now is 02:02 AM. |