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

Mikey mikeythek at gmail.com
Mon Feb 20 12:22:34 EST 2006


I've now been programming in a pile of different languages, including
various assembly lanuages, and several "dead" ones for just about 30
years.  However compact and quick-to-write B, C, and their derivatives
are, they are unbelievably difficult to read, which prompted one
speaker at a VAX programming conference session on languages some 20
years ago to remark that C was a "Write-Only" language.

I really like xtalk because it is so conversational, so it's very
simple to write and very simple to read.  By contrast, I just recently
picked up a customer that has several million lines of COBOL, and
despite the fact that COBOL is probably the easiest to read
business-logic language that has ever been, I find it very difficult
to plod through, especially when (as is the case with this client),
there is almost no documentation, and there are almost no version
notes.

All of that said, I HATE the new-fangled way that SWITCH works in more
modern languages.  Back in "the day", CASE was used for multi-state
conditionals, and after each condition was handled the construct would
break.  I would have rather had a dontbreak than a break, just for
that reason.  I am much more frequently writing code that would be
more in the if elseif elseif endif type of setup than the commonality
that SWITCH is designed to handle by default.
--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the use-livecode mailing list