why python annoys me

Ken Seehof kens at sightreader.com
Tue Apr 17 21:47:25 EDT 2001


From: "Luke" <floods at netplus.net> says:

> 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...

Actually __*__ is used for special method overloads such as __init__(),
__add__, __str__.

__* gets you "pseudo hiding".  This is an improvement over the 'private'
keyword because you know from the name that you are looking at a private
rather than referring back to a declaration.  Actually the underscore
concept
exists specifically because python doesn't have declarations (except when
it does).

Pseudo hiding is an improvement over true hiding since it is equally
effective in preventing accidental abuse, but doesn't actually limit the
programmers options.  It's often extremely useful to be able to break
all the rules temporarily while debugging, for example.

Java and C++ programmers are encouraged to use naming conventions like
pm_blob to indicate that the variable is a private member.  Of course every
programmer follows different conventions in this regard, so that technique
is
not reliable.

> 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.
> 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.
>
> 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.

Almost everything in "Programming Python" and "Learning Python" still
applies in python 2.2.

> 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'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.

I think "stupid" and "illogical" are synonyms which can be defined here as
"different from something else I am familiar with."







More information about the Python-list mailing list