alice-teacher EVENTS vs Return Functions

James Vanderhyde jvanderhyde at benedictine.edu
Thu Apr 7 13:48:07 EDT 2011


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
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
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.andrew.cmu.edu/mailman/private/alice-teachers/attachments/20110407/4eb46279/attachment.html 


More information about the alice-teachers mailing list