Feb
26
Infamous GoTo statement was far many years banned from the software community.It started with Dijkstra's letter to "Communication of the ACM". Soon GoTo was blamed for making programs hard to read, promoting speghetti code. Steele and Sussman in their classic paper "Lambda: The Ultimate Imperative" mention a "gotophobia" which occured in academic world in early seventies.
First, programmers were tought "Don't use goto or you're burn in hell!". Then it was removed (or: not included) in coming programming languages. GoTo was blamed, banned and forgotten.
Recently the new trend in web application development is gaining momentum. Continuation-based web servers, including Seaside and Iowa, promise better mental model for web application (for details see Seaside tutorials). But what is continuation?
Wikipedia states that continuation is " a representation of the execution state of a program (for example, the call stack or values of variables) at a certain point." What it really means is a new incarnation of good ol' goto. But it's a first-class citizen now. You can create a "goto target" anywhere, pass it to or return from a function and store in a variable. GoTo tamed. GoTo civilized. Goto 2.0.
But is was considered harmful, wasn't it? Well, not any more. First, it's considerend a function (or compatible). You simply call it to jump to the point it was created at. Second, it encapsulates the state it was created at (control state, not full state).
This gives you two important properties. One, in case of errors, you can tweak the environment and retry the computation. Second, you can go back in time :-).
The GoTo's younger brother is not only unharmful. It's fashionable and smart.