Best Practices in Rev development
scott at cdroo.com
Thu Jun 21 12:41:24 CDT 2007
----- Original Message -----
From: "J. Landman Gay" <jacque at hyperactivesw.com>
> I read somewhere a long time ago that switch statements run faster than
> if/else. I think it was a general comment rather than specifically related
> to Revolution programming but it was so long ago I can't recall. Does
> anyone know if it is true for Rev scripts?
I haven't timed it - but if it's read by the engine in the same manner other
programming languages handle it then it would be faster as any subsequent
conditions are skipped because once the case statement (switch statement) is
met the compiler knows not to proceed - as opposed to if/then/else etc where
the entire handler is evaluated in full.
More information about the use-livecode