call me mad, but I want goto…

November 24th, 2003 by Hen

So I’d never realised this was legal:

public class fred {    public static void main(String[] args) {        boolean a = true;        boolean b = true;

        C: if(a) {            if(b) { break C; }            System.out.println(”HAPPENED”);        }        System.out.println(”DONE”);    }

}

Old memories of hacking around in basic and various other languages are trying to resurface and overturn the ‘follow the standard idioms for readable code’ brainwashing.

One Response to “call me mad, but I want goto…”

  1. Robert M. Zigweid Says:

    Bayard, if I find code of yours that uses this obfuscated bullshit…Ok so I’m not sure what I’d do, but it’s bound to not be as ugly as THAT!