Why self?

Brian Quinlan brian at sweetapp.com
Mon Jul 8 14:13:05 EDT 2002


Robb wrote:
> I completely agree, but I think the situation's even worse than you
> described:  A'typical' case of standard OO programming is made the
most
> tedious to write:  References to instance variables from methods:
> 
>      self.__velocity = self.__factor1 * self.__factor2
> 
> etc.  I find this totally unreadable (7 extra characters per
referenced
> instance variable).

Two of those characters are your own fault (the underscores).

I find this very readable (except for the names "factor1" and
"factor2"):

	self.velocity = self.factor1 * self.factor2

Cheers,
Brian






More information about the Python-list mailing list