Friday, July 10th, 2009
GOTO is here

Ah GOTO. Now life is complete. How could one enjoy a Fun Friday better than looking at a goto implementation in JavaScript:
-
-
<script type="text/jsplusgoto">
-
var a = 0;
-
[lbl] topOfLoop:
-
a++;
-
if (a <292 ) {
-
goto topOfLoop;
-
}
-
document.getElementById('relevantLink').setAttribute('href', 'http://www.xkcd.com/' + a);
-
</script>
-
Note the "text/jsplusgoto" in there. The nice simple parseScripts abstraction is used to find that code, munge it to JavaScript, and then run it.












Kill it. Kill it with fire.
[lbl] 1964;
goto 1964;
only something this terrible could make me register. I pray to god that whoever made this, got hit by a bus today.
The interesting thing there is parseScripts — what a cool way to add features to JS!
But, please, no “goto”. ;)
Let’s not GOTO there, people.
You can hide the raptor with CSS, but you can’t fool me.
It is actually useful in some languages (I have found uses for it in C#), but not Javascript.
Wtf is [lbl] for? JavaScript has native support for labels and you don’t need to precede them with [lbl].
the xkcd comic refreed to is @ http://xkcd.com/292/
Is this a joke? ….. I checked my calendar, and it’s not April 1.
Some people need to actually read the article and related blog post. Why do some people only read the headline and go from there?
The guy actually states that this is a joke.
The whole thing reads as a joke even before the guy admits it. No one understood when he says he doesn’t condone the use of functions? Functions are for the weak?
Come on people.
@travisalmand
This is the internet. The internet is made up of 50% people with acerbic wit and biting sarcasm, and 50% people who believe everything they read.
Just the fact that someone could read this and think it’s a good idea is dangerous enough.
Too bad parseScripts doesn’t actually parse scripts into anything other than a big blob.
Clearly this only makes sense. Since PHP got that operator now, there needs to be a unified programming model on the server and on the client. I hope this ist part of ECMAScript soon.
… this won’t end well!