[MWForum]When or if
Jeff R
mwforum@lists.mathcats.com
Tue, 12 Nov 2002 22:44:11 +1100 (EST)
On Tue, 12 Nov 2002, Trish Sims wrote:
> I've been teaching year 8's (age 14) to use MicroWorlds. Lots of very
> successful projects but I'm having difficulty understanding and explaining
> the difference between proceedures that include
> when [touching? "t1 "t2] etc
> and
> if [touching? "t1 "t2] etc
Trish
WHEN will launch an independent paralllel process each time it is invoked;
it's like LAUNCH and FOREVER. This can be very powerful, but it i can
quickly give rise to bugs and unintended consequences that can be hard to
trace. For most cases, I find that IF will do the job. It's easier to
understand within a procedural programming model.
cheers
Jeff