RE: The "goto" discussion on the Internals List

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
Goto has (I believe) been described as a method of shooting yourself
in both feet at the same time. 
[/snip]

goto (not a 'new' construct as was mentioned earlier) had its uses, but
thos would seem depricated now as you can call a function, which is
essentially what a goto did. Consider;

if('foo' == $bar){
     goto(1001); //essentially a line number (remember, old school)
 OR  goto(LABEL); //defined constant
} else {
     goto(2001);
}

VS.

if('foo' == $bar){
     assimilate($bar);
} else {
     anhylate($bar);
}


Where problems arose from goto they would arise from function use as
well. Nesting goto's was every bit as challenging as properly
constructing regex statements. goto also did not fit as well with OOP
methodology, being more of a procedural construct in accordance with the
procedural programming at the time that it was conceived.

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux