Main menu puzzle, Klaus
Thomas McGrath III
3mcgrath at adelphia.net
Sun Feb 19 00:41:16 EST 2006
Judy,
"Guys" and "Gals", (sorry). ;-)
Also, I hope you are feeling better.
I know if then's made sense to me when I first started and I probably
would never have thought up a switch statement. But I guess once I
saw how it worked I didn't find it to be as some have said "Machine-
speak" but rather as sensible. I mean as a list of choices that the
item could be and when the right choice is found then 'break' out of
the statement completely.
I was curious, and thanks for your response, why I didn't feel like
others did about it.
To be fair though I would write the case as compared to your if then
like this:
switch mailArrived
case "I got paid"
pay the rent
break (stop here)
case " I didn't get paid"
get ready to move
break
end switch
But I guess I am starting to see by the way you wrote them how it
would be 'more' english like with the if-then's for a simple statement.
Since I know how simple adding different cases to test for is with a
switch, I would use the if-then's for simple two or three line tests
but I would use the switch-case for more than that and also if I was
building case scenarios along the way. They are quite easy to add to.
Thanks for sharing and sorry again about the lack of gals in my prev
email.
Tom
On Feb 19, 2006, at 12:19 AM, Judy Perry wrote:
> Thomas,
>
> Well, as a "gal" as opposed to a "guy", I'll submit the following:
>
> In everyday/non-programming life, we just don't think in terms of case
> statements; we think in terms of if-thens:
>
> case paycheckArrivesInMail
> payRent
> switch
> case paycheckNotInMail
> waitToBeEvicted
> switch
> ...
>
> I dunno... maybe y'all do... but I think thus:
>
> IF I get paid THEN
> I can pay the rent
> ELSE I risk getting an eviction notice
>
> If-Then is just another way to express cause and effect, one of the
> earliest things we learn as humans (also known as the permanency
> effect:
> that irritating thing babies do when repeatedly dropping things
> from their
> view, only to be delighted when you, as predicted, return the items to
> them).
>
> Case statements may well be more elegant, take fewer
> lines/characters/whatever... but it's machine-speak, not human-
> speak. If
> I wanted machine-speak, I'd learn to program in octyl...
>
> Judy
>
> On Sat, 18 Feb 2006, Thomas McGrath III wrote:
>
>> Hey guys,
>>
>> I don't understand why you guys don't like switch case statements?
>> Really. I am trying to remember the first time I saw and used them
>> back in Supercard. I remember thinking they were more difficult to
>> write but once I did they seemed to do a lot more than if then's or
>> at least with fewer words.
>> I am curious to maybe what I saw that others didn't or what others
>> see (and don't like) that I didn't see.
>
>
> _______________________________________________
> 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
Thomas J McGrath III
3mcgrath at adelphia.net
Lazy River Software™ - http://www.lazyriversoftware.com
Lazy River Metal Art™ - http://www.lazyriversoftware.com/metal.html
Meeting Wear™ - http://www.cafepress.com/meetingwear
Semantic Compaction Systems - http://www.minspeak.com
SCIconics, LLC - http://www.sciconics.com/sciindex.html
More information about the use-livecode
mailing list