Mailing List Archive

Interesting thread on comp.lang.perl.misc
There is an interesting thread discussing (in a more-or-less reasoned
way) the relative merits of Perl and Python. It's called "Why use Perl
when we've got Python?". Despite the provocative subject its not
designed to start an advocacy war, and there are some very interesting
comments being made about shortcomings in both languages.

If you know both Perl and Python, I am sure your contribution would be
welcomed.

Ian.
Interesting thread on comp.lang.perl.misc [ In reply to ]
Ian Clarke <I.Clarke@strs.co.uk> wrote:
: There is an interesting thread discussing (in a more-or-less reasoned
: way) the relative merits of Perl and Python. It's called "Why use Perl
: when we've got Python?". Despite the provocative subject its not
: designed to start an advocacy war, and there are some very interesting
: comments being made about shortcomings in both languages.

: If you know both Perl and Python, I am sure your contribution would be
: welcomed.

Coming from a voice (in a choir) of experience, it does not go over well
when a lot of Python lovers post "we love Python because of..." in the
c.l.p.m newsgroup. As you found, the Perl newsgroup is a different beast
from the Python newsgroup, but one thing is in common - we are each a
little defensive when ppl come to the newsgroup.

As you noticed from the postings (I had been reading the thread on
c.l.p.m), you had a number of people who were touting Perl and also
claiming they knew nothing about Python ("but that doesn't matter because
Perl is great"). You asked a perfectly valid question, just not in the
best way or to the best forum.

So what is the best forum? Good question. The best would be to find
papers by reputable persons who fairly judge the languages. You got a
very good response from Tom C. Read what he says; he's fair about both
languages.

-Arcege
Interesting thread on comp.lang.perl.misc [ In reply to ]
On Aug 13, Michael P. Reilly blah blah blah:

> So what is the best forum? Good question. The best would be to find
> papers by reputable persons who fairly judge the languages. You got a
> very good response from Tom C. Read what he says; he's fair about both
> languages.

I program both Perl and Python. I'm in clpmisc and clpython. What do I
do when such debates come around? I ignore them. I do, however, be sure
to make well researched and as unbiased comments as I can if I do happen
to say a sentence or two.

Many people find python's whitespace dependency to be stupid. I love it.

Many people find perl's leading symbol characters (@$%&*) to be stupid. I
love them.

I wish Perl had Object.Attr OO functionality as in Python.

I wish I could change a string in-place with a function.*

But I like the two languages. Holy wars are not for me.


* meaning:

def func(str):
# something modifying str

str = "foo"
func(str)
print str # prints... "bar", for example

In Perl, you can modify arguments to subroutines:

sub func { $_[0] = "bar" }
$str = "foo";
func($str);
print $str; # prints "bar"
func("jeff"); # that's an error, you can't change a constant

Ok. That's it for me. :)

--
jeff pinyan japhy@pobox.com japhy+perl@pobox.com japhy+crap@pobox.com
japhy's little hole in the (fire) wall: http://www.pobox.com/~japhy/
japhy's perl supposit^Wrepository: http://www.pobox.com/~japhy/perl/
The "CRAP" Project: http://www.pobox.com/~japhy/perl/crap/
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
Interesting thread on comp.lang.perl.misc [ In reply to ]
In article <Pine.GSO.4.10.9908131047510.3761-100000@crusoe.crusoe.net>,
japhy@pobox.com wrote:
> I wish I could change a string in-place with a function.*
> [bobbit]
> * meaning:
>
> def func(str):
> # something modifying str
>
> str = "foo"
> func(str)
> print str # prints... "bar", for example

Enclose it in a list, which is mutable:

def func(l):
l[0]="bar"

>>> l=["foo"]
>>> func(l)
>>> print l
['bar']

A little clumsy, but it works!


--
Cliff Crawford -><-
http://www.people.cornell.edu/pages/cjc26
empty-handed I go,
)O( and behold the spade is in my hands


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.