Re:Finally... Goto in Javascript
by 10ren on Monday July 06, 2009 @07:49PM
(#690669)
> The clearest way to express certain algorithms really does involve a (local) goto.
Java doesn't have goto, but it has labeled break and continue statements. Great for exiting nested loops. Exceptions are another kind of structured goto. Of all the criticisms of Java, I've never heard the lack of goto bemoaned.
One thing I love about the Java designers is their humility: they thought the above was enough to cover all the cases where a goto was really convenient, but still made goto a reserved word. Just in case.
Java doesn't have goto, but it has labeled break and continue statements. Great for exiting nested loops. Exceptions are another kind of structured goto. Of all the criticisms of Java, I've never heard the lack of goto bemoaned.
One thing I love about the Java designers is their humility: they thought the above was enough to cover all the cases where a goto was really convenient, but still made goto a reserved word. Just in case.