Dispatch

Richard Gaskin ambassador at fourthworld.com
Wed Aug 3 14:49:47 EDT 2022


Sean Cole write:

 > I was particularly asking if there was any 'advantage/disadvantage'
 > in using
 >
 >  dispatch myHandler with myVar
 >
 > over just using
 >
 >  myHandler


In coding as in life, when in doubt leave it out.

If something isn't needed it's usually simplest to not go out of your 
way to add it.

The message path is fine.

It works reliably, and with as much efficiency as the team can throw at 
it. In most cases it's not only the easiest thing to type and the most 
efficient to execute, its simplicity and predictability also aid 
debugging and maintenance.

For those times when you need an exception to the message path, LC 
provides many.  Send, do, call, dispatch, etc. - each has their own 
unique set of tradeoffs that make it a good fit for the specific 
circumstance where the native message path isn't what you need.

But those are for exceptional circumstances.

The native message path is the norm of this language.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com



More information about the use-livecode mailing list