Javascript and UnitTesting
I’ve been getting back into Javascript coding recently, and as is my wont I immediately start looking around for a) a unit testing tool, and b) a toy project to fiddle around with where I don’t have deadline pressure and am free to try more cutting edge technologies than at work (where, for example, we’re still limping along on Java 1.4 and IE 6, because for a large corporation upgrading tens of thousands of workstations is a headache of Brobdingnagian proportions).
For the first, there’s jsUnit. Whenever I wonder whether my profession really is making progress, given that many of the complaints in The Mythical Man-Month could have been written yesterday instead of thirty years ago, I comfort myself with the fact that whatever language I start fiddling with I can count on there being an xUnit test framework just a Google search away. jsUnit appears to be a fairly straightforward port of jUnit, so it should be easy enough to get the hang of. I also see that it comes with a mini server app that’ll let you incorporate jsUnit tests into Ant scripts, which should be useful if I ever try to sell my workplace on using it.
For the second, I’m contemplating rewriting my Python table rolling program as a plug-in for TiddlyWiki, because that’s mostly what I’ve been using lately for campaign notes for my RPGs, and it already has all the javascript objects and methods I’d need for self-modifying an html page based on the results of rolling on the tables. The more I look at it, the more I admire TiddlyWiki’s simplicity and flexibility, and it’s inspired me to a new approach to defining random tables for games. Where before I had a fairly elaborate special-purpose XML mark-up language, now I’m planning on just using standard HTML (with maybe a few extra attrs). You want a list of options? Make an HTML list, then just use a TiddlyWiki macro to roll a random result from the list.