Matlab vs Python (was RE: Discussion: Introducing new operators for matrix computation)

Thomas Wouters thomas at xs4all.net
Wed Jul 19 15:41:29 EDT 2000


On Wed, Jul 19, 2000 at 01:21:55PM -0400, Charles Boncelet wrote:
> Paul Prescod wrote:

> I agree it should be selective about the features it adds.  But 
> sometimes (no, *often*) I believe it is too selective and too slow 
> to change. "+=", for instance, should have been added years ago.  
> C had it in the 1970's; Perl had it in the 1980's. Python does 
> not yet have it. Stodginess like this puts off a lot of programmers.

Any idea why are += and friends still not implemented, after 5+ years of
Python development ? Guido and Tim both claim they wanted it years ago. Yet
noone came forward and implemented it, and Guido and Tim were both too busy
with more important things. And everyone else would have had to code up to
their standards, which is no small feat ;-)

Eventually it got coded. Michael Hudson wrote a simple proof of concept, and
that got me started on Python internals, which are really incredibly simple.
Using a single posting by Guido and a clarification from Tim, which Tim
claims hasn't changed significantly in the last year at least, it took me,
as a complete Python-internals newbie, a total of about 12 hours to rewrite
Michael's patch to one that did everything Guido wanted, and was only a
little buggy. And I'm not that special a programmer that noone else could've
done it, either.

So, what's the difference between Python and Perl ? Well, maybe the number
of programmers that also program C, and are comfortable with hacking a large
program like Python ? Or maybe Python programmers are generally more happy
with Python's limited featureset than Perl programmers are with Perl's ? :)
Probably a combination of both.

I discussed Perl/Python internals with our resident perl guru. I only heard
a small bit about Perl internals, but I heard enough to wonder how people
ever got new features added to Perl ;)

> Python would be more popular.  Witness Perl: it has adopted lots of 
> ideas from its userbase and has grown immensely as a result. 

Why would people want another Perl ? There already is one. It already does
everything.

> (IMHO, the main problem with Perl is not that it has adopted lots of
> ideas, but that it didn't have a firm foundation to begin with. I.e.,
> the core language is broken.  Python's core language is much stronger
> and Python would be improved with some additions.)

Probably, yes. But it wouldn't have a strong core if all those features
already were in there ;) Python has a strong core *because* Guido has always
been conservative in his changes. And in his coding style. And in a ton of
small things, that might not matter by themselves but all together they
damned well make the language what it is.

Which doesn't mean in the slightest bit that he won't change anything. He
just needs a good reason, and 'seems logical' can be a very good reason.
Which is why augmented assignment (+=), list comprehensions and range
literals are beign considered for 2.0: Guido literally asked for the last
one, himself.

(And to prove a point: he also asked for parallel iteration, literally, but
that patch isn't going in: he was out-voted ;) and instead it'll be a
builtin: zip)

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list