BIT-101 [2003-2017]

Obligatory Silverlight Post


First let me say that it’s not my intent to bash Silverlight, or defend my beloved Flash platform. In fact, it looks like I may very well have to be doing some work with Silverlight at my job, so it’s something I’m going to need to learn and get used to. This is why I decided to give it a look over today. I have to say, it wasn’t quite what I expected

Secondly, let me say that I’ve only given it a quick look over, and I may be missing a lot.

The first thing I realized is that the way Silverlight apps are created is with XAML and JavaScript. XAML I knew, but the JS surprised me. I’m not sure what I thought the apps would be coded in, and I guess JavaScript makes sense, but again it just surprised me.

**[EDIT] So, after reading the comments here, and some other stuff, it does seem that you’ll be able to code in some more powerful languages, such as C#, eventually. This is not ready for the current CTP release, only the JavaScript engine.[/EDIT]
**
You could make an analogy to Flash/Flex by saying that XAML is Silverlight’s MXML and JavaScript is its ActionScript. XAML is the XML based layout language that defines the assets, graphics, etc., and JavaScript supplies the application logic and behavior. But the way it is all deployed is quite different.

In Flash and Flex, the whole package is compiled into a neatly packaged SWF, which is embedded in the page. The end user can never see the MXML or the ActionScript, unless you decide to publish it along with the app.

In Silverlight, the XAML and JavaScript is right there in its raw form. You embed an instance of the Silverlight plugin, pass in the path to the XAML file that it will consume, and make the JavaScript available to the page. The Silverlight plugin then consumes the XAML and JS and renders the app. So there is no concept of ‘compiling’ a Silverlight app, anymore than you would compile an HTML/Ajax application. This obviously makes dynamic applications fairly simple. You can have PHP, ASP, Java, or whatever you use on the server to generate your XAML on the fly.

The one thing that really concerns me though is the use of JavaScript as a language for “the next generation of RIAs” (which, by the way, means Rich Interactive Applications now, according to Microsoft :)). If you are an ActionScript 3.0 or even 2.0 programmer who wants to dive into Silverlight programming, you are going to have to take a 5-year step backwards to prototype-based classes. Welcome back ActionScript 1.0, circa 2002! Here’s a quick sample:

[js]function root_Loaded(sender, args) {
new tileText(sender);
}

function tileEntry(value, offset) {
this.value = value;
this.offset = offset;
}

function tileText(rootCanvas) {

// Hook up the button event handlers
var button = rootCanvas.findName(“button”);

// omitted a bunch of code here…
}

tileText.prototype.handleMouseEnter = function(sender, eventArgs) {
var buttonBG = sender.findName(“buttonBG”);
buttonBG.fill = “#FFa0a0a0”;
}[/js]

Ugh. I was so happy to get away from that stuff when AS2 came out. I really can’t imagine coding the kind of huge dozens-or-hundreds-of-classes type of application that you see being done in Flash and Flex these days, using prototypes. I guess this is what Ajax developers do every day, and heck, we all did it back when, but I’m not really excited to go back to it.

Now, the one big thing I do see Silverlight has going for it is the video, particularly with the DRM. I know that a lot of our customers at Brightcove are going to be scrambling for that, which is why I say I’ll probably have my hands in it soon. Then again, I have no doubt that Adobe has an answer to this. I can only hope they bring it to market in time to be a viable competitor to Silverlight – so that I don’t have to get my hands TOO dirty. 🙂

On a less technical note, I gotta say, I HATE the name. I can’t ever get it right. I’m stumbling over Sparklelight, Sprinklelight, Silverfish, etc. before I spit it out. John Grden suggested “Steely Dan”, but we won’t go there…

And last but not least, did you see the Silverlight wallpapers??? Come on Microsoft!!! You get pissed off when people accuse you of copying Apple, and then you put out this?

Silverlight Wallpaper:
silverlight wallpaper

Default OSX Wallpaper:
panther wallpaper

« Previous Post
Next Post »