At 9:04 PM +0100 9/24/10, Ashley Sheridan wrote:
I don't often use this type of logic, but I have used it before and it's served me well. Essentially, a switch is a glorified if statement, and I find them a lot nicer to read and write than a series of if/elseif blocks.


Thanks,
Ash

Ash:

Exactly my take.

I wouldn't live next door to an ELSEIF even if it lived in a good neighborhood. :-)

However, I always thought (maybe in error) that the switch control (CASE statement) was derived from the computed GOTO rather than from the three-way IF statement.

One can make the argument that the ELSE IF statement first surfaced circa 1977 in FORTRAN 77 and the CASE statement came later in FORTRAN 90 circa 1991. But I know I was using computed GOTOs and GOSUBs long before then.

In any event, to me the computed GOTO is more like the CASE statement than ELSE IF.

Cheers,

tedd

--
-------
http://sperling.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to