A lurkers ravings (was RE: Smalltalk beep -> XXX beep?)

Andreas Raab andreas.raab at gmx.de
Wed May 14 01:16:25 UTC 2003


Hi Russel,

[Replying out-of-order]
> Why is beep in Object at all? All the objects in Squeak don't need to
> know how to beep. The sound system needs to know how to beep.

No. The *system* needs to know how to beep. The sound system knows how to
play elaborate sounds but the system may - in the absence of full sound
and/or display support - still need to have a way to provide user feedback.
#beep really has nothing to do with sound (what kind of music is beeping?)
so what it really does is either to raise the user's attention or
alternatively to indicate progress. Here, #beep is among the lowest levels
of support which is why I would put it either into Smalltalk or Object. And
the latter mostly because it means less places to touch. But #beep has
nothing to do with sound whatsoever - it might actually be implemented in
ways which aren't even aural.

> It seems to me that this is the reason Squeak is spaghetti code in the
> first place, people aren't sure where to put something so it goes in
> object and now us newbies cant find anything or figure out 
> what to use.
> Plus you are teaching us bad object design habits! :-)

No, not really. Let's assume I have a headless system which has a (limited)
kind of sound support. Implementing #beep in Object I can have various
implementations of #beep which all sound differently. So that (for example)
I can use the sound for debugging (this is no theoretical example - I have
done exactly this in the past and since it was in C it was a real PITA).
Using Whatever>>beep does not even give you the chance to provide
polymorphic responses to such messages.

In addition, it can be much more intent-revealing if you know *who* you are
asking to do something. For example, Object>>error: is not required either
(you could do the same with Utilities>>error:) but still it's typically a
specific object which we think has a problem so that anything but 'self
error' is very revealing indeed.

> Andreas you commented in AbstractSound "beep in the presence of the
> sound system. this method may still #primitiveBeep if sound	support
> is disabled or doesn't work or whatever". So use that please 
> don't clog up Object with methods that aren't required.

What is "required" depends heavily on what you're doing. Object>> -> isn't
required either but I still haven't seen anyone asking to remove it. There
is a fine difference between "required" and "useful".

Cheers,
  - Andreas



More information about the Squeak-dev mailing list