Switch or If

Richmond Mathewson richmondmathewson at gmail.com
Thu Apr 23 15:00:26 EDT 2009

Hey, that was the only thing useful I learnt doing my "M.A" in IT at 
Abertay: what happens when you are
hit by a number 10 bus?

This is the reason my Granny always slipped on a clean pair before she 
went shopping. :)

Now, I am a bad programmer in several respects; and the worst is that I 
don't comment my way
through my code so when the next system development lifecycle comes 
round (Ha, Ha, Ha . . .
What SDLC in a one-room EFL school with 3 computers . . . you can see 
why matter attitude is a
bit slack). However, I for one, find reading through other people's code 
a lot easier to understand
with if . . . then loops rather than 'switch'; I never use the latter as 
on coming back to it later my
logic gets befuddled.

sincerely, Richmond Mathewson.

Richard Gaskin wrote:
> Phil Davis wrote:
>> Unless you're building something where the small difference in speed 
>> is absolutely critical, I would seek to answer a different question:  
>> Which structure will be easier to understand and maintain in the 
>> future when I (or others) come back to it?
> Wise words.  While I often adhere to the motto "A clock cycle saved 
> today is a clock cycle that can be put toward more powerful features 
> tomorrow", we need to balance that with time-to-market and robustness.
> In many cases it should be possible to make whatever evaluation needs 
> to be done with either "case" or "if" outside of repeat loops, so you 
> can use whichever form best represents the logic involved while 
> optimizing performance even more than using either within the loop.
> -- 
>  Richard Gaskin
>  Fourth World
>  Revolution training and consulting: http://www.fourthworld.com
>  Webzine for Rev developers: http://www.revjournal.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

More information about the use-livecode mailing list