Python misconceptions in IBM Ruby article...

Skip Montanaro skip at mojam.com
Fri Feb 18 13:09:11 EST 2000


    cpp> This is just a display that you haven't mastered C++.  In your C++
    cpp> code sample, you on purpose introduced two variables integer
    cpp> i. The one is the  private data member, and the other is the formal
    cpp> parameter of function member foo. Just because of that you need to use
    cpp> 'this' to be explicit.

Clearly that was a contrived example, but Moshe only wrote it to demonstrate
that you can encounter situations in C++ where explicit use of this is
required for disambiguation.  In large C++ projects it's not all that
uncommon to have coding conventions that require the explicit use of
"this->" to clearly distinguish references to member data from variables,
even when there is no conflict.

Skip Montanaro | http://www.mojam.com/
skip at mojam.com | http://www.musi-cal.com/
"Languages that change by catering to the tastes of non-users tend not to do
so well." - Doug Landauer




More information about the Python-list mailing list