Pages

Monday, February 22, 2010

Eclipse RCP and Python

The two have nothing to do with each other in this post.  But I felt like griping about something.

So with the Eclipse RCP (rich client platform) technology, in theory one can create an eclipse-based application and run it on any OS that has a compliant Java runtime.  So why do I find that there are many Eclipse RCP applications designed to work on only certain operating systems (mostly Windows and Linux)?  I just don't understand.  These same apps should work on OS X, too.  It doesn't make any sense to me.



Now for python.  I'm not sure why this is the case, the documentation is no help, either, but why when defining a class and its methods do you have to put for its first argument the keyword 'self'.  Huh?  Can't it just be implied?  I mean look at this code:


class Bag:
    def __init__(self):
        self.data = []
    def add(self, x):
        self.data.append(x)
    def addtwice(self, x):
        self.add(x)
        self.add(x)

What's with all of the 'self' parameters?  Is this not just like a waste of bytes?  This is from the python tutorial:

Often, the first argument of a method is called self. This is nothing more than a convention: the name self has absolutely no special meaning to Python. Note, however, that by not following the convention your code may be less readable to other Python programmers, and it is also conceivable that a class browser program might be written that relies upon such a convention.

No special meaning?  Just a convention?  Huh?  WTF?  It just seems ugly and stupid to me.  No doubt there is some underlying reason for this convention.  It had to come from somewhere.  I just don't get it.  Yuck.

Reblog this post [with Zemanta]

0 comments:

Post a Comment