A big teacher wish

Richard A. O'Keefe ok at cs.otago.ac.nz
Wed Nov 27 01:13:01 UTC 2002


Stephane Ducasse <ducasse at iam.unibe.ch> wrote:
	all this is something that I really appreciated in VW7.0 and I think 
	that it would
	save a lot of energy to teachers and to newbies. I would loved to 
	rename classVariables
	as sharedVariables (what they are in fact). This way we could say 
	instanceVariables, class instance variable and shared variables.
	
"shared variables" sounds like the things you find in PoolDictionaries.
It's a very poor name because it fails to reveal what's the most salient
thing about these variables:  each class variable is owned by some specific
class and is visible within that class and its descendants.

"class variables" are things that belong to classes.
"instance variables" are things that belong to instances.
It doesn't get much clearer than that.

"class instance variables" are admittedly confusing,
BUT they are also extremely rare.
In the whole of Squeak 2.8 there were just four of them,
in MorphicModel and Player.  In 3.2 one of those class instance
variables has gone away.  There are now 13 classes with a total
of 16 class instance variables:
    CardPlayer		variableDocks
    ExternalStructure	compiledSpec
    Interpolateable	value
    InterpreterPlugin	timeStamp
    MorphicModel	prototype
    ObjectMemory	timeStamp
    PhonemeSet		arpabet
    Player		scripts slotInfo
    Player157		cardPlayer111 unscriptedPLayer1 unscriptedPlayer2
    Player176		player157
    TestResource	current
    UnscriptedPlayer	ephemeralPlayerRef
    VRMLClassNode	nodeSpec
There are 1770 classes containing 5566 instance variables and 1288 class
variables, so class instance variables are just 0.23% of the total number
of variables, and more than that, are concentrated in a handful of classes
that newbies are unlikely to be concerned with (at least until they are
no longer newbies).

It seems to me that teachers and newbies would save more time and energy
by simply ignoring class instance variables completely than they would by
changing the name of a core concept to be LESS meaningful and LESS helpful.




More information about the Squeak-dev mailing list