A big teacher wish
lex at cc.gatech.edu
Fri Dec 6 12:54:02 UTC 2002
"Richard A. O'Keefe" <ok at cs.otago.ac.nz> wrote:
> 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.
Incidentally, a class variable and a pool variable (or whatever you call
the things in pool dictionaries) are extremely similar. Their only
difference is with which methods can access them. Likewise for global
variables: it's the same thing, only visible everywhere.
This similarity is so strong that it even appears in the implementation
of these things: all three kinds of pools of variables are stored as
Anyway, I'll second that students get confused over this difference.
However, I'd like to point out that almost no beginner programs need
class variables at all, and thus they can be left out for a long time.
In fact, you may decide even to just use global valiables -- after all,
class variables have just shy of the bad design problems that global
variables do. It's too bad that class methods aren't quite as easy to
do without, because those confuse people too; but maybe there, as well,
people could use a "Foo new initialize" style and thus avoid class
methods for a long time.
More information about the Squeak-dev