Bjoern Schliessmann <[EMAIL PROTECTED]>
wrote:
   ...
> Mh, strange, I personally like to use "this.a" in C++, to make clear
> I use an instance variable.

That would be nice, unfortunately your C++ compiler will refuse that,
and force you to use this->a instead;-).

Many programming shops use naming conventions instead, such as my_a or
a_ (trailing underscore for member-variables) -- I've even seen the
convention this_a which IMHO is silly (at that point you might as well
use this->a and avoid the 'convention'!-).

Anyway, I essentially agree with you (except for the C++ bit: since this
is a pointer, it needs ->).  However, full disclosure, Smalltalk/XP
superstar Kent Beck disagrees -- in his good book "Test Driven Design by
Example", in the chapter where he gives the Python example, he DOES
whine against the need to explicitly say self (the one bad bit in the
book:-).

For the curious: the explicit-self idea is essentially taken from
Modula-3, a sadly now forgotten language which still had an impact on
the history of programming.


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to