This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Let me tell you about...
Feed Title: Avi Bryant
Feed URL: http://smallthought.com/avi/?feed=rss2
Feed Description: HREF Considered Harmful
Bill Clementson posts that although a lot of people are interested in the use of continuations for web applications programming, nobody has yet come up with an elevator pitch explanation of their benefits. My pitch usually goes something like this: "Continuations bring precisely the same benefits to traditional web development that subroutines bring to GOTOs". Julian Fitzell and I had to expand on this for a tutorial we gave at Smalltalk Solutions. Here's the first part of the abstract:
Dijkstra may have taught us 45 years ago that GOTO was a bad idea, but web development has barely caught up. In the CGI model of web applications, each link that is followed triggers an entirely new execution of the program. Building complex control flow out of these abrupt transitions can lead to a tangled and brittle mess of interdependent pages. Modern frameworks such as WebObjects and Struts may remove many of the difficulties of CGI scripting, but they do not escape the web's inherent GOTO: moving from one page to the next, whether through anchors, actions, forms, or forwards, is still a simple one-way jump.
Seaside is a framework for developing web-based applications that insulates the developer from the HTTP request/response loop, presenting the illusion of a continuous interactive session with the user. Each page or form acts much like a subroutine, which returns a value to its caller based on user input. Complex, conditional or looping workflows can be described in a single piece of straightforward Smalltalk code as a sequence of calls to individual pages. The benefits this brings to the reusability and maintainability of web applications closely mimick the advances made by structured programming long ago.