[oclug] Python, was: Evolution problem
Michael P. Soulier
msoulier at digitaltorque.ca
Tue Jun 17 23:13:33 EDT 2003
On 17/06/03 Dave O'Neill did speaketh:
> I seem to have a bit of a reputation as a Perl bigot around here for
> some reason. Let it be known that I hate all software equally. =)
We'll get along just fine. :) I agree with the Mutt motto, slightly
adjusted. All software sucks. Linux and open-source software just sucks
> It's a schizophrenic language. Parts of the standard Python library are
> kinda-sorta UNIX-like, and others aren't. For example, it's annoying
> when calling close() on a popen()'ed file object returns the exit status
> of the process EXCEPT when it succeeded, when it returns None instead.
> Or that some standard library calls throw Python exceptions, making a
> stat() test for a nonexistant file into an ugly exception case.
> There's also the tortured list-manipulation syntax -- why have a pop()
> but no push(), for example.
:) You just hit on some of my major annoyances. Mind you, it's easy
enough to add a push, aliased to append(), and fix other annoyances as
well, but I agree that you shouldn't have to patch your language.
The reasons are simple. Python was born on Unix, and since then, has
become very popular with Windows people as a replacement for VB. This
alone has tempted me to give up using it. But, I try to keep an open
None being akin to false, I've never noticed the inconsistent return
from popen(). I like exceptions for the most part, and their rare use in
Perl is a sore point for me. It's difficult to shoehorn the POSIX API
into a language that prefers exception handling, so there ends up being
shock value for those used to C and Perl.
I have other complaints about Python, beyond the infiltration of
windows crap. It's too damn slow, although they've improved that in
2.2.3. Certain things are incredibly easy, like slicing sequences, and
meanwhile munging numbers can be a PITA thanks to Python's "not quite
strongly typed" philosphy. However, my single biggest complaint is that
for all the Python community's preaching about language simplicity being
soooo important, they keep adding features to the core language. This
pisses me off to no end. I'd be happy if Python stopped at 1.5.2, even
if interators and generators are cool. Python pushes readability of
code, and yet they add list comprehensions from Haskall. Does this look
readable to you?
removelist = [ file for file in names
for pat in spatlist
if re.search(pat, file) ]
And they complain that Perl lets you say
$foo = $bar if $bar =~ /fubar/;
It's simply amazing at times.
All that said, I find Python absolutely perfect for object oriented
programming. C++ and Java make it difficult, even though I've used both
to great success. OO Perl is ugly as sin, even though I willingly use it
every day. Python is just gorgeous for OO. I love it.
But, life being all about change, Perl 6 may motivate me to drop
Python, if they fix my complaints about Perl 5 and Python in one stroke.
Whether that happens remains to be seen. So far Perl 6 looks like a big
mistake, but time will tell.
> Perhaps it's just that I'm currently writing code in too many C-like
> programming languages to appreciate the wonders of Python, but when I
> write Python code it seems like a lot of things were done they way they
> were just for the sake of being different, not because it was better.
That's my complaint about Eiffel. Different for the sake of being
different. If Python continues that way, I guarantee you I'll be hanging
out at the Perl Mongers meetings instead. Right now I don't see it that
way. Python has some great innovations that Perl could learn from, and
is in fact.
Sometimes I wonder if dividing myself between multiple languages
hurts my ability in all of them. What do you think? Is it better to keep
your head buried in one language, or be eclectic and check out lots of
Michael P. Soulier <msoulier at digitaltorque.ca>, GnuPG pub key: 5BC8BE08
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort." -Harley Hahn, A Student's Guide to Unix
HTML Email Considered Harmful: http://expita.com/nomime.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://tux.oclug.on.ca/pipermail/oclug/attachments/20030617/02dc7a40/attachment.bin
More information about the OCLUG