Main menu puzzle

Rob Cozens rcozens at pon.net
Sat Feb 18 15:45:52 EST 2006


Judy, et al:

> Not being a programmer, I find if-thens more comprehensible than case
> statements.  They both do the same thing, but one speaks more to normal
> humans and the other more to programmer-geeks.
>

As a programmer, I see any "if" construct with more than two mutually 
exclusive alternatives as crying out for switch [case] syntax.

Not only is it easier to comprehend the total logic flow, but adding 
new alternatives is much simpler.

Perhaps my programmer's background blinds me to case "geekness"?   Is

on menuPick thePick
   switch thePick
        case "New Mainstack"
             ....
             break
        case "New Substack"
             ....
             break
        case "Open Stack..."
             ....
             break
        [etc.]
    end switch
end menuPick

really less comprehensible to "normal" people than

on menuPick thePick
   if thePick is "New Mainstack" then
             ....
   end if
   if thePick is "New Substack" then
             ....
   end if
   if thePick is  "Open Stack..." then
             ....
    end if
   [etc.]
end menuPick

?


If the "programmer-geek" syntax is easier for me to use, understand, 
and modify, that's the syntax I would choose in my examples to both 
programmer-geeks and normal folks.

Rob Cozens
CCW, Serendipity Software Company

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)




More information about the use-livecode mailing list