rootbeer at redcat.com
Fri Sep 9 02:23:53 UTC 2005
On 9/8/05, Blake <blake at kingdomrpg.com> wrote:
> -> Still wondering about the Squeakland image; the download is less than
> 1MB, so obviously it's not in there (right?).
Still wondering about what you're asking; the sentence is only two
lines long, so obviously there's no question in there (right?).
> -> When you're developing classes and testing stuff out, do you expose all
> the instance variables? And then later, remove the accessors you don't
> want the user to have?
Nope. But unless I have a reason to hide them, I have accessors for
all instance variables, as a rule.
> I notice that to test/debug it's often easiest to
> have access to everything from the Workspace, but really don't want that
> to be exposed to clients of the class.
You have access to everything in an Inspector, too, so you don't need
to make an accessor merely for development.
> -> If you were creating a deck (of cards) class and a card class, would
> you put the card's rank and suit in as strings or as symbols, keeping in
> mind that you were later going to reveal the class to students for
> educational purposes? I know I want the deck to be card neutral, i.e., to
> be usable for a deck of any sort of cards, but the cards themselves (for
> standard decks), for convenience, are described as being (rank) "King" and
> (suit) "Hearts". But perhaps that should be #king and #hearts. (I tend to
> worry about making global symbols: seems like courting trouble.)
It sounds as if you're worried about your #king being a problem if
there's also a #king used in chess, say. But you can share #king just
as you can share $R and 42. Global symbols are global constants, not
Hope this helps!
More information about the Squeak-dev