Question:
Perl or Python?
bakegoodz
2007-02-05 23:21:14 UTC
Which language would you recommend? I want to learn programming basics. I have tried to learn C++, but have had a very hard time. Some say that learning higher level language then C(++) first is better. I am also a Linux Nut, and like to become a master of scripting and the command line. I have already become swayed to Python, because I have heard it is a cleaner more straight forward language. Your thoughts are appreciated.
Four answers:
KnightSpot
2007-02-05 23:29:50 UTC
I C++ was hard, then I'd say Python would be your better choice. It is a much more straight forward language. Perl has some real power in it which is linked to its built in regular expression handling capabilities...however this makes the language much more difficult to read, and requires you to really learn two languages perl and regular expressions to really gain the full power of Perl...I'd stick with python if your already moving down that path.



Scripting has some real advantages, and I believe both of these can be compiled scripts to improve performance if need.
jake cigarâ„¢ is retired
2007-02-06 07:57:14 UTC
Learn them both together! Although they are different, there are similarities, you may find one easier.



Each has advantages! Perl is more prevalent. Python is cooler. Perl has a greater base and is more mature. Python is a new language clean from horrible old practices. Perl is the language that most classic websites use. Python is one of the newer languages of choice (along with ruby!!!!), Perl is complex, but complete, with loads of pre-written modules! Python interfaces well with java (jython is pretty cool). Perl can interface with C and java, and many other languages!



the list goes on and on... Learn both!



also Regular Expressions are an important part of all modern languages... you need to learn that too!



UPDATE!

a great byproduct of perl is the ability to throw together scripts! Python perhaps less so, but they can both do the job. C can't!
Russ H
2007-02-06 08:01:54 UTC
I think it would be more important to determine how you are going to learn to program. From a book? In a class room setting? On-line course? Extension class at a university? It will be very difficult to find a course on computer programming which uses Python at its core, so your choice of instruction may determine your initial language. I have programmed extensively in many languages, beginning with assembly language on several architectures including the hypothetical MIX machine (check out Donald Knuth's Art of Computer Programming), moving to Algol 68, Pascal, MS Basic, Visual Basic, C, Awk, PHP 4/5, Javascript, Python and Ruby. Lots of shell programming (bash, sh, MS-DOS .bat, REXX, ...) too. Each of these languages has its place. None of them "teach" you how to program - that is done by using a teaching source of some kind. I recommend a classroom situation to begin with so that you can have guidance and someone with experience help you through the maze as you begin. There are so many wrong turns to take. If you are just interested in light programming then I would use PHP... it's friendly, has a fantastic selection of libraries, and it's free. Check out Eclipse on Linux/Unix/Windows (http://www.eclipse.org). It is a very good development environment which supports many different languages.



Good luck!
griv
2007-02-06 07:25:38 UTC
Python is a more relaxed language (like PHP). It will allow you to get the job done with less frustration than Perl for the beginner. Perl (Practical Extraction and Report Language) was designed primarily to read and extract data from large database / text files, and is very quick at doing so. Start with Python (or PHP).


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...