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

Judy Perry jperryl at ecs.fullerton.edu
Mon Feb 20 13:16:02 EST 2006


Mark,

On Sun, 19 Feb 2006, Mark Wieder wrote:

> > Case-Switch statements are preferred by "real" programmers.
>
> Not so. I've put forth the situations in which I would normally use
> switch statements, but I do use if/then statements (and even elses) a
> whole lot. I even nest them.

Fair enough!
>
> It's kind of like getting past the hurdle of writing your first
> function. And why you would want to do that in the first place.

Yeah, my programming binky is still firmly clenched between my teeth on
this one @;-)

> But, yes, I'm in agreement that first you teach the if/thens - they're
> the basis of programming. And why HTML isn't a programming language.
> Once someone's mastered basic conditionals then you can start working
> other things in (elses and elseifs and switches and such).

Funny (or not) side story: probably about 10 years back I was volunteering
heavily for our local MESA (Math, Engineering, Science Achievement)
Program (minority, er, underpriviledged, er, underrepresented.. or
whatever's the current term, junior & senior high school students).  The
program (funded out of the University of California President's Office and
corporate sponsors) has a big semi-stateswide competition each year in
various areas such as egg-toss, making various mechanical thingies,
crystal growing, etc.  The local director or her assistant was wanting to
submit an activity for something Computer Science-related and, came upon
the idea of a webpage-creation contest.  Only, it wasn't to be hand-coded
in HTML.

Instead, it would be a competition in using FrontPage.

It took alot of lobbying to get them to abandon the FrontPage part of it,
so heavily entrenched was the notion that webpages are akin to magic and
thus the art of making one -- even a very simple one -- was too difficult
for high school students.

Judy




More information about the use-livecode mailing list