alice-teacher EVENTS vs Return Functions

Tony Bowes tony-bowes at stlukes.qld.edu.au
Thu Apr 7 15:08:16 EDT 2011


I'd argue that it would depend on the amount of objects to exhibit the same behaviour. 1-2 it's probably easier to implement as individual events, but if you're looking at 10's or 100's you'd be wanting a function to allow some form of code maintainability. Somewhere in the middle would be a grey area where students transition from handling each event independently to seeing the virtues of abstraction.

Tony Bowes

From: alice-teachers-bounces+tony-bowes=stlukes.qld.edu.au at lists.andrew.cmu.edu [mailto:alice-teachers-bounces+tony-bowes=stlukes.qld.edu.au at lists.andrew.cmu.edu] On Behalf Of James Vanderhyde
Sent: Friday, 8 April 2011 3:48 AM
To: Alice educators
Subject: Re: alice-teacher EVENTS vs Return Functions

I don't think there's a difference in efficiency. Which technique is preferable and which is logically easier is a matter of opinion. There may be one difference, though, with how multiple clicks are handled. Try clicking on multiple philosophers quickly in a row. I think the multiple events technique will try to run the handlers simultaneously, which will have weird effects in the scene. With only one event, the clicks will queue up, sort of.

James
--
Dr. James Vanderhyde
Math and Computer Science
Benedictine College
jvanderhyde at benedictine.edu<mailto:jvanderhyde at benedictine.edu>
http://vanderhyde.us/~james/pro/



On Apr 6, 2011, at 3:49 PM, Elaine Demeter wrote:


A few of my students redid the "Learning to Program with Alice" exercise of Zeus zapping the philosophers by using multiple event statements instead of using a boolean return function.

They thought it was "logically" easier to to check for each philosopher (ex: when the mouse is clicked on "SOCRATES") as an event rather than by creating the return function with all of the IF statements. Is one manner was more preferable or efficient than the other?

Elaine
_______________________________________________
alice-teachers mailing list
alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers


________________________________
NOTICE - The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. All information contained in this email is "commercial in confidence". Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you have received this message in error please notify the sender immediately and destroy the original message.

St Luke's Anglican School has implemented anti-virus software, and whilst all care is taken, it is the recipient's responsibility to ensure that any attachments are scanned for viruses prior to use.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.andrew.cmu.edu/mailman/private/alice-teachers/attachments/20110408/f39c0d72/attachment.html 


More information about the alice-teachers mailing list