[Tutor] Problems with references

Alan Gauld alan.gauld at blueyonder.co.uk
Thu Jun 3 08:07:21 EDT 2004

> let me rephrase
> 1. "self" is that a reference to the class or an instance of the

OK, I'll rephrase too.

In a class method self refers to the class object itself.
In an instance method it refers to the runtime instance of the class
in which it is defined.

> 2. Since that there are different paradigms within the OOP
> which one is the most "correct"? (I know it is a wierd question.)

The real problem lies in the broken way in which C++ and its
define a class. They treat a class as a weird mix of type definition
namespace rather than as a full blown object in its own right. Adding
static methods/attributes to the class namespace only partially solves
the problem. IMHO of course, Bjarne Stroustrup may disagree :-)

Alan G.

More information about the Tutor mailing list