Python vs. Perl
Rob Nikander
nikander at mindspring.com
Tue May 22 19:34:07 EDT 2001
In article <mailman.990569132.16898.python-list at python.org>, "Jonathan
Gardner" <gardner at sounddomain.com> wrote:
> am going to miss a lot of the C features that I live and die by (while
> (a = getc())), and I am going to miss the "do this or die unless that"
> aspect of Perl. What does Python have that makes it so great? Why should
> I spend time to become intimate with it? I am looking for comments from
> people that actually have used Perl or C/C++ extensively, and I am
> looking for comments that go beyond the FAQ.
I haven't used much Perl, but there is a huge difference from C/C++
because you can do dynamic stuff like:
str = getCommandFromSomewhere()
exec str
Where str is a string of actual python code. That is basically
impossible in C/C++. This may not mean much in certain apps, but for
something I was coding the other day, this ability (which is also present
in Lisp, Perl and other interpreted languages) was much-needed.
Also, I love doing things like:
x, y, width, height = obj.getDimensions()
assigning 4 variables at once because the function returns a tuple. But
maybe you can do that in Perl too... probably.
My impression was that Perl's OO was a little ugly, so if you are a
object guy, you will like Python better. Python is the cleanest, most
convenient language I have ever come across.
Rob
More information about the Python-list
mailing list