Stateless programming
Just about all of my programming experience was with languages like Perl or C++, making whats known as “stateful” programs. That means the program moves through specific states, and everything moves along a set path. Its very easy to have the program direct the user along a predictable path. Designing such programs is fairly easy because the application is in control of everything that happens.
Working in web programming you get into “stateless” programming. This means that the program doesn’t have fixed states, things happen in a more random manner. The program still can direct the user to some extent, but a lot of the control is given to the user. They can create bookmarks to a page in the middle of the application, they can close the browser whenever they choose, and they can click the back button or type in a URL to jump out of the program. All these things can upset the order you intend for the user to follow, and it makes the programs much more difficult to design.
It takes a lot of work to determine how the user arrived at each page so that it can react accordingly. Not to mention the user can have multiple browser windows open to your application, and you have to track each one of those separately.
In stateful programming its very easy to block any of those things from happening. You just put in an “I’m sorry Dave, I can’t do that right now” error messages in any time they deviate from the intended path. There’s no good way to do that in stateless programming that I’ve found.
You could put in roadblocks, have each page pass a token to the next page in the program. Then if the user ever encounters a page but doesn’t have the right token it can redirect them to where you want them to go. That kinda ruins a web application though, every expects to be able to jump around haphazardly without running into problems.
I suppose thats one advantage of websites made with Flash. They can be done in a stateful way, and still be handled by a web browser. This also will be a big appeal to the new Flex language, and with its more open release I’m curious how many pages will be converted to Flex.




