Explicit Frustration of the Self

Skip Montanaro skip at pobox.com
Tue Dec 31 10:34:42 EST 2002


    dw> What of elegance?
    ...
    dw> This whole business with the self; it is not elegant.  

Check this out:

    Use "this" inside of methods even though C++ doesn't require you
    to. This really seems to make the code more readable because it
    disambiguates between instance variables and local or global
    variables. It also disambiguates between member functions and other
    functions.

This is a direct quote from the VTK coding standards.  VTK is a very large
(much larger than Python) scientific visualization library written in C++.
These folks know what they are talking about.  Hell, I wouldn't be surprised
if they deleted all the unrequired "this->" constructs from the VTK code the
total number of bytes removed would be more than the size of the Python
source code. ;-)

So, lose the anger.  Put on a purple dress and have a go blowout time for
New Year's.

-- 
Skip Montanaro - skip at pobox.com
http://www.musi-cal.com/
http://www.mojam.com/




More information about the Python-list mailing list