JavaScript Thoughts

Part of the process of installing that chat app the other day (which is now gone, by the way - it was fun but distracting) was also modifying the JavaScript that did stuff on the client. I've never worked with the XML objects (i.e. Ajax) before, but back in 1999 I worked on a quick project for Levi's in San Francisco doing a bunch of JavaScript stuff for an in-house database app, so I actually remembered quite a bit about how the DOM tree worked, etc. A lot has changed since then, but a lot is still the same. That and some online references like Simon Willison's great JavaScript tutorial got me up to speed pretty quickly. I had forgotten how quick and easy JavaScript can be. But then I hit the wall pretty quickly as well, as there's a ton you can do with JavaScript and I'm hardly a guru.

Last night's discovery of TiddlyWiki really opened my eyes though. I have since learned is a type of app dubbed a Single Page Application, another example is NextAction, which is a GTD-based task manager (written using Junction - a Rails-like development environment for JavaScript!). Both have all the logic they need written in JavaScript inside the HTML page and reside on your hard drive. I think this concept is pretty amazing. The idea that you can have a Rich HTML Application in your browser with lots of interactivity but be able to use it offline and save data locally is just really cool. It took me a bit to wrap my head around it, but I'm totally into it.

I wonder why there's not more self-contained apps like this, written using nothing but markup and JavaScript? Microsoft was going along this path for a while I remember - they had a bunch of stuff you could do with the Windows Scripting Host - including creating COM objects in JavaScript and full-on GUIs, etc. But this is a bit different - because the SPA apps live in my browser, I can interact with them in a familiar way, and they can stay focused on a specific task. Essentially becoming full-page, browser-based widgets, right? I mean, yeah, the browser's UI can be wonky, but this a is pretty awesome concept.

And that brings me back to to the language itself. While I wasn't paying attention, JavaScript seems to have worked its way into a lot of different development environments, no? I still had it in my mind that JavaScript is what you use for development when there's no other option, like in browsers, and until just recently I'd rather have it disabled than deal with pop-ups, etc. But in fact, it's almost becoming the defacto scripting language for all non-Microsoft based Rich GUI applications. Flash uses ActionScript (a form of Javascript) - I was looking at this stuff recently because of the launch of Flash Lite 2.0. Then there's the widget platforms: Yahoo! Widgets uses the same JavaScript engine that's in FireFox (again I was looking at this recently as well), Apple's Widgets are based on the KJS engine, etc. I bet you there's other good examples as well.

It doesn't look like server-side JavaScript will ever take off (PHP rules the world there), and Microsoft I'm sure will continue to push C# as the way to get things done in the Windows OS which limits its adoption on the desktop despite implementations like JScript.NET. But still I think the idea that not only is JavaScript still around, but thanks to widgets and Ajax apps, is actually thriving again is pretty interesting.

Is there a good Windows JavaScript interpreter? I'd love to whip up quick little scripts to do stuff on my desktop as easily as I can whip up a PHP script on my server (i.e. query a URL, parse the results and do something interesting). All FireFox installs should include command-line access to the JavaScript engine. That would be cool - potentially a bit dangerous - but cool.

-Russ

< Previous         Next >