"Too many 'self' in python.That's a big flaw in this language."

by jesse in ,


The title is of course not my creation - it is another thread on comp.lang.python (serious, you should stop by, I lurk a lot and read posts from that xiu fellow). In this particular thread:

I'm currently using Python. I find that a instance variable must confined with self, for example: [snip] That's a big inconvenience in coding ,especially when you have lot of variable If you method need 10 variables ,you have to type "self" for 10 times and that also makes your variable longer. From My point,I think this only help python interpreter to deside where to look for. Is there anyone know's how to make the interpreter find instance name space first? Or any way to make programmer's life easier?

That's the original post. Without delving too deep into the nuances of his critique - I like explicit self. As Bjorn wisely points out "Explicit is better than implicit.

I really don't understand the near visceral dislike of "self." some people have. I mean, "self" you're passing in, calling, reference your local, "self" scope/object/underpants.

I mean, I really like self, and I find myself missing it learning Java-Fu.