Chained Behaviors

Richard Gaskin ambassador at fourthworld.com
Fri Jul 12 16:37:06 EDT 2013


Richmond wrote:
> On 07/12/2013 08:58 PM, Richard Gaskin wrote:
>> Peter Haworth wrote:
>>> Has anyone got any real world examples of the benefits of the new
>>> chained
>>> behaviors feature?
>>>
>>> I just read the latest newsletter article about them and while I
>>> understand
>>> the concept,  I didn't see benefit in the example scenario over a single
>>> behavior with some common logic and a switch statement to handle the
>>> logic
>>> specific to each "sprite".
>>
>> It obviates the switch statement.
>
> And what, pray tell, is wrong with switch statements?

Nothing.  Use 'em where you like 'em.

OOP is a code design issue.  There are countless arguments around the 
'net about the benefits of OOP, and those are probably better than any I 
could come up with because I find myself here in a cognitive bind:  I'm 
unable to understand how one level of behaviors can be seen as valuable 
but multiple levels not seen as adding even more value.

But that's just me.  Whether I can explain why I like 'em or not, I look 
forward to using 'em.

And if instead you prefer one long script with conditionals, you can 
enjoy that too.

Everyone has what they want here.

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  Follow me on Twitter:  http://twitter.com/FourthWorldSys




More information about the use-livecode mailing list