Why self?

Richard Barrett R.Barrett at ftel.co.uk
Mon Jul 8 14:13:00 EDT 2002


At 17:42 08/07/2002 +0000, Robb Shecter wrote:
>Matt Gerrans wrote:
>
>>In Python, I think the required "self" reference in methods is a case where
>>the solution is worse than the problem it solves.   Since indentation is the
>>method of scoping in Python, this addition of five characters to each
>>instance variable is particularly annoying -- a one-line statement that
>>contains several instance variables can easily become unmanageable.
>
>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).
>
>Robb

And now you are going to tell which language (compiled or scripting, 
functional or procedural, or whatever) with OO capability is more 
productive, from the standpoint of tested lines of code per day, as Python ...






More information about the Python-list mailing list