High Hopes for Silverlight 2.0

Let me start out by admitting that I haven’t done a whole lot of client-side scripting. I’ve written a few DHTML scripts in vbscript and in jscript, but I haven’t written a hard core Ajax application.

That said, the RIA (Rich Internet Application) technology has always seemed terribly crude to me compared to what’s available for thick clients and for server-side web applications. As I’ve mentioned in previous posts, I find .NET incredibly productive for writing Winforms (thick client) applications. I’ve written some ASP.NET code, too, and I think that Microsoft has done a good job of providing a reasonable continuum between how one writes Winforms and Webforms (server-based Internet) applications. Both approaches rely on event-driven programming and both let you use visual tools to design forms/pages and to hook them up with code.

When I wrote ASP.NET applications, I was happy to be able to use the Web as a delivery mechanism and I was happy to not have to worry about writing installers and updating customer software. On the other hand, I was never happy with the quality of the end-user experience (the web UI) compared to what was possible with a thick client. The page oriented nature of Web applications resulted in poor user feedback. I felt like I was, once again, running IBM 3270 CICS applications as I did in the 70’s.

Keep in mind that one of the great benefits of cheap computing power is the luxury of using that power to provide kestroke-level interactivity. The best examples of this are Intellisense in Visual Studio or on-the-fly spell check in word processors. With slower CPUs, UI validation and other operations were typically only performed during focus transitions (for example, when the user tabbed from field to cield). With even slower CPUs, validation was only performed at the transaction level (when the user pressed OK to submit the form/dialog).

With crude Web-based apps, it doesn’t matter that you’re running a two-processor, quad-core, system; validation only happens when you press OK (or for the leather crowd, Submit).

RIAs are supposed to solve this problem. BTW, I’m using RIA, because I want to talk about this without specifying a particular technology, just yet. A RIA, after all, could be implemented various ways:

  • As a java applet
  • As a Flash application
  • Using vbscript/jscript client-side scripts

I find something inherenly wrong with the first two approaches. Java applets are often plain old ugly. Your browser page marks off a big square while the browser goes off and loads some stuff that clearly belongs to another world. The buttons and fonts look wrong. Subtle things (menus, etc.) behave differently. Yuck. Flash applications are better looking, but I hate web sites that are 100% Flash. You find youself deep in the site and want to save a bookmark but, lo and behold, your URL is the same URL you started with. Everything you’ve done has taken place in Flash.

The last approach is the one taken by Ajax. You write conventional web applications (in Java or .Net or whatever) but the pages that you deliver to web browsers contain client-side scripts to provide a more keystroke interactive experience. If you’ve used recent versions of Google Mail or Yahoo or Hotmail, you’re experienced this approach. In addition to client-side scripting, Ajax also performs XML-based Web requests to “quietly” get additional information without having to perform disruptive page transitions.

The concept of client-side scripting is good. My objections to it are in its execution. Vbscript and jscript are poor substitutes for the full-fledged language features found in Java or .NET languages. Typelessness might be “in” with compiler developers but it results in tremendously flaky code. Additionally, the object model available to client-side scripts is the DHTML object model. DHTML might have been fine in 1998 but it’s very limiting 10 years later.

Silverlight 2.0 promises to change this. It will allow client-side scripting to be done with any .NET language. I am a C# fan, but you can use VisualBasic or PHP# or Python# or whatever other .NET language you like. Silverlight will provide a rich visual object model for UI programming. It provides a nice visual programming tool for UI design that’s based on XAML and the new Windows presentation layer.

While all of this sounds very Microsoft-centric (and undoubtedly, it will take a while for Firefox and Safari to catch up), Microsoft has tapped the Novell Mono folk to provide Moonlight – an implementation of Silverlight on non-Windows systems.

So far, I’ve mostly read about Silverlight 2.0. I hope to spend some time taking it through its paces, soon, and will report on this once I do. If Microsoft has provided a good continuum between Winforms, Webforms and Silverlight (not to mention Mobile apps), it will have truly accomplished a great thing.