I was somewhat surprised to discover that a dislike was taken to my 5 minute Hangman game that I wrote the other day and James Robertson screencast about.
Much to my dismay, an anonymous heckler felt he should criticize it - fair enough, the code was pretty crap - but he also took the opportunity to knock in some low blows. For that I'm annoyed at the guy - but for criticizing the hack job I did - sure, fair enough.
I think it's important we all remember that on the other end of a communique is a real person - blindly (and especially anonymously) lashing out at someone is not a nice thing to do.
Past that unhappy note - I decided that if I was going to throw up a Hangman game and people were going to learn off of it (which wasn't my initial intent) then I guess I should write it properly. By 'properly' I mean expand it form one simple hacked up WAComponent in to a WATask with some WAFormDialog subclasses and a proper WAFileLibrary subclass instead of a File Repository subclass.
Naturally, as you'd expect, the code explodes out in a few different directions at once - no longer do we have the one class hack but instead we have several classes that have an intent and purpose and hopefully the peanut gallery will be more happy with the code (fingers crossed).
Version 4 of Hangman in the public repository has all of the changes to it. While I was at it, I decided to throw in a decoration to center and give the game a background. In a full application where you're randomly popping up dialogs and all sorts of things you'd go to a bit more effort in this regard and make it consistent. I'm still being lazy here so if you think I've cheated again, yell (politely!) in the comments.
I threw in some basic CSS to style it a bit more nicely instead of nesting inside pre tags and dozens of divs. I stopped spewing out a zillion spans when I didn't need too. All the usual things you do _after you've done a quick spike_.
So if you are playing with Seaside and you think may be the Hangman program might be a nice example of how to do something more than "Guess the Number" then take a look. I still won't hold it up there as the perfect example of a Seaside application (nor did I ever intend it to be!) but I think it holds its own a bit better than the hack I did initially.