why python annoys me

D-Man dsh8290 at rit.edu
Tue Apr 17 19:24:11 EDT 2001


On Tue, Apr 17, 2001 at 05:08:14PM -0500, Luke wrote:
...
| 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.

I think this improves readability.  How do you know whether the
original coder is refering to a local variable or a member of the
object?

| Is it procedural or OO?  Some of the std lib seems to think it is OO,

I would call it a very OO language.  _Everything_ is an object.  Even
integers, functions, classes, and modules.  You can write code that
looks and feels procedural, if that is the proper paradigm for the
problem.

| 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 not more object oriented -- think of 'int', 'char', etc.  They
are not objects.  Java is very _class_ oriented.  Why do you need ot
make a class that serves no purpose other than to hold a static
function so your program can run (main)?

| 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 find python to be much more comfortable and easy to deal with than
Java.  Java's type system is very restrictive and it doesn't have high
level data structures and control structures like lists, dictionaries
and the 'in' operator.  Casting is ugly and Java _requires_ it if you
use any collections at all.  Not to mention the primitive/array/Object
split.

-D





More information about the Python-list mailing list