Switch versus if/then/else ( was: Main menu puzzle, Klaus)

Judy Perry jperryl at ecs.fullerton.edu
Sun Feb 19 00:27:39 EST 2006


Yes, but do you think in these terms in day-to-day life?

IF I have the paycheck in-hand THEN
  it will clear the bank in 2 days
  I can write the rent check tomorrow and it will clear at the same time
END IF

IF the paycheck arrives tomorrow THEN
  IF tomorrow is not a weekend day THEN
    I can write the rent check the day after and be late but it will clear
  ELSE if tomorrow is a weekend day THEN
    I will write the rent check two days later, be late, pay the late fee
    and the rent check will still clear
END IF

ELSE I'm screwed.

(Am I the only person on list who has to worry about when checks clear???)

Oh, and in any case, if you don't already know case statements and
switches, THEY JUST DON'T MAKE MORE SENSE than if-thens!

And, even if you do, it's still not how normal humans describe
cause-and-effect phenomena in non-programming situations.

Judy

On Sat, 18 Feb 2006, Eric Chatonet wrote:

> Hi everyone,
>
> Does switch is able to bring more flexibility and readability than if/
> then/else?
> The answer is yes.




More information about the use-livecode mailing list