why python annoys me

Paul Prescod paulp at ActiveState.com
Tue Apr 17 19:38:49 EDT 2001


There are lots of things that are wrong with Python but I don't think
you are entirely fair.

Luke wrote:
> 
> Python is an ugly language...
> 
> Why should you have to name stuff with __*__ to get some pseudo hiding?
> Or for any reason for that matter...

It turns out that part of the Python philosophy is that hiding (pseudo-
or otherwise) isn't really that important and is typically
counter-productive. I tell people around me not to use it.

> Why do you always have to access class data members as self.* What a
> pain in the ass, and anti-OO.  In a Java class, you don't constantly
> have to write this.feature = this.feature2 ++; if this.a > this.b etc...
> How tedious that would be, and is with Python's self.

That's a fair opinion, but it isn't accurate to call it "anti-OO". What
is anti-OO about it? How does it interfere with polymorphism,
inheritance or encapsulation?

> Is it procedural or OO?  Some of the std lib seems to think it is OO,
> and the other half seems to think it is procedural... I mean sometimes
> you create a new object with new, other times you just get a reference
> by calling a function.  Even Java is more object oriented than this--you
> *only* write classes, and the standard library is *only* made of
> objects.  Python gives too many ways of doing it.

Java is a *strictly object oriented language*. Of course Java is more OO
than Python. OO isn't magic pixie dust to be sprinkled over everything.
On the other hand, I think it is fair to say that Python's standard
library could be more organized. It is the product of hundreds of people
with different coding styles. The Python world cannot afford (yet?) to
reject robust, useful code because it uses a different style than other
robust, useful code that we've already got in the library.

Note, however, that Python has XML (as an example) in the standard
library *NOW* while Java's is in a community standardization process or
something like that.

> Furthermore, the syntax and features of the language keep changing with
> every release.  For God's sake!  I regret ever buying programming python
> and learning python... I feel like they're already out of date.

You couldn't sell a pre-Swing Java book at a yard-sale!

> There are lots of nice things about python like its built in [] and {}
> and I really like the indention, but I'm about to go back to Java, a
> language I know very well and feel comfortable in.  

I think that's the crux of it. You learned Java first and you are more
comfortable with it. That's fine.

> I'm not slamming it,
> it has lots of potential, but there are so many stupid illogical
> features in Python that just ruin the whole experience.

There are thousands of people on the mailing list who have had the
opposite experience. As far as I can tell, you are in the minority among
people who learned Java and then learned Python. Most love Python.

-- 
Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.ActiveState.com/pythoncookbook




More information about the Python-list mailing list