Is it advisable to replace 'self' with '_' or 'I' or something shorter?

Max M maxm at mxm.dk
Tue Jan 21 16:56:38 EST 2003


oofoe wrote:
> Hi!
> 
> jbperez808 at yahoo.com (Jonathan P.) wrote in message news:<f57664b9.0301110959.5b1439da at posting.google.com>...
> 
>>I agree with the fact that explicit use of self is good
>>for code readability, however it tends to make code lines
>>too long.  Since 'self' is just a convention, I wonder if
>>people out there have tried replacing it with a one-character
>>equivalent without encountering any problems.
> 
> 
> I dislike the word 'self' for the method's object argument. It's
> clumsy to say and lends an unwarranted arrogance and formality
> to the method call. I prefer the much more friendly name 'my'.


You are fighting an uphill battle against the windmills here!

Use "self" and get over it ;-)

If you ever want your code to be seen by others, it is a bad idea. Why 
should they read "obfuscated" code? If you ever want to read other 
peoples code, you won't be used to see self. Also a bad idea.

regards Max M


-- 

hilsen/regards Max M

http://www.futureport.dk/
Fremtiden, videnskab, skeptiscisme og transhumanisme





More information about the Python-list mailing list