Microsoft’s Silverlight 3 delivers decent alternative to Adobe
A difficult act to swallow
Review Silverlight's future looks bright, which is just as well.
The initial release of Microsoft media player for the browser lacked many of the features Flash had offered for years. Version 1.0 was really little more than a dressed up beta and, while the current release is an improvement, it still lacks many advanced capabilities that have seen Flash set the standard.
Silverlight 3.0, released as a beta recently, promises to put Microsoft's player on a nearly level playing field with Adobe's Flash framework. Silverlight 3.0 brings a staggering amount of improvements to the table with new APIs, audio codecs and features for video such as Smooth Streaming, H264 and AAC, and hardware-based graphics acceleration.
But how easy is it to develop in Silverlight? And how much has Microsoft closed the feature gap with Adobe's Flash platform? I've been taking the Silverlight 3.0 beta for a spin.
The test track was a photo gallery I built using Microsoft's IronPython that contained 40 photos pulled off of Flickr and served up using a local Ning server. I picked this project because the basic mechanics of a slideshow such as loading images from XML and cross fading them are something I've done a plenty of times using Flash over the years, so this made comparisons relatively easy.
From the development IDE to the massive load of new APIs, Silverlight 3.0 is designed to make developers' lives easier, and that's an important part of Microsoft's strategy because many web developers remain wary of Silverlight's primary development environment - the Microsoft family of .NET languages.
Give us the tools
Using the .NET framework means Silverlight 3.0 offers more robust programming tools than Flash developers have access to. Visual Studio 2008, the primary IDE for Silverlight, blows Adobe's Flash IDE out of the water. Of course most Flash developers have long since moved to outside tools like Eclipse and there are also Eclipse plug-ins for working with Silverlight.
The biggest flaw in the Flash IDE is that it basically encourages bad code, you can bury code in a literally infinite number of places - external files, movie clips, timeline frames, frames within movie clips. It gets ugly very fast. Visual Studio 2008 integrates nicely with Subversion and other version-control systems so your code is organized in a logical way from the beginning, making it easier to update, maintain and share with other developers.
There is no frame-based animation, so it works more the way programmers are accustomed to working - with a collection of files compiled into a finished app.
The other thing you get with Silverlight is access to "real" programming languages. Sure Adobe's ActionScript is capable of creating some powerful apps, but Flash and even the Flex framework lack the sophistication and maturity you'll find in the .NET framework. Silverlight also offers a much wider range of development tools - Silverlight apps can be built with anything from C to Ruby.
That said, if you're a designer familiar with the Photoshop, Illustrator and Flash workflow, you'll absolutely hate Microsoft Expression Studio - the primary tool for building Silverlight interfaces. Expression Studio feels like it crawled out of 2001 and it's primary component, Expression Design, could compete quite nicely with Illustrator 3.0, but Adobe long since left this sort of primitivism in the dust.
Expression Studio is really geared only towards generating graphics for Windows Presentation Foundation (WPF) projects and it lacks the kind of pixel editing tools for graphics you'd find in Photoshop, for example. Strangely, older versions have Pixel layers but for some reason the latest release dumps them. Really the only advantage is that Expression Studio can export to XAML, which is useful for Silverlight developers. Also, compared to another Adobe application, Dreamweaver offers pretty good support for web standards, where as Expression Studio doesn't.
What about animation, a mainstay Flash and Silverlight? Flash has some programmatic animation libraries but most Flash projects still rely on some amount of timeline animation. Now contrast that with Silverlight, which uses the WPF animation model - a time-based model.
WPF also lets you define the start and end conditions and can automatically calculate the movement for you. In fact, once you wrap your head around it, WPF "just works," and can save you tremendous amounts of time. Animating the opening of images in our slideshow app, for example, required just ten lines of code cut and pasted straight from the documentation.
The main niche Silverlight is fighting for is the one that Flash has settled into - drawing complex graphs and charts, animation, and of course, delivering audio and video over the web.
Indeed, Silverlight's biggest inroads so far have been in streaming video applications and the new tools in the latest beta only make it more tempting for developers. Silverlight 3 will be able to stream up to 1080p HD video.
Like Flash 10, (which can also stream 1080p HD video) Silverlight now takes advantage of GPU acceleration, but Silverlight has a new trick that might give it an edge over Flash - something Microsoft calls Smooth Streaming.
Smooth Streaming allows Silverlight 3.0 to stream at up to 1080p, but automatically adjusts video quality based on a your internet connection and local processor load. If your bandwidth is lower, say you're stuck on a slow public WiFi, the streaming server will lower the video quality to ensure that you aren't stuck in buffering hell. You can check out the smooth streaming tools available at IIS.net
No streaming for LAMP
Smooth Streaming requires the Internet Information Services 7.0 environment in Windows Server 2008. That means you're never going to be smooth streaming videos from your Linux, Apache, MySQL, Perl, Python or PHP stack and will be simply relying on Silverlight 3.0 just to handle the player.
In typical Microsoft fashion, the Smooth Streaming tools are a package affair and you'll need to swallow the package hook, line and sinker before you see any benefits.
That's a big commitment if you're not a big organization broadcasting movies to an Olympic-size audience, but Silverlight 3.0 offers another tantalizing tool to sweeten the deal - the ability to build offline, stand-alone, desktop applications, much like Adobe's AIR platform.
The best part about the standalone apps aspect is that you don't need to alter any of the application's code. The only thing to do is create a short XML file (AppManifest.xaml) and define a few settings. Suddenly your app can be run both inside and outside of the browser.
But that's only part of the appeal, there's also a revamped and much improved local data store API, called Isolated Storage. The Isolated Storage API is a way to store data for offline web-apps in Silverlight. Again, accessing it is dead simple and thanks to the updates in version three you can now store data for your users regardless of whether they're using the web or desktop version of an app or switching back and forth between them.
Double-click desktop advantage
Unfortunately, Silverlight's desktop app experience is a little behind Adobe when it comes to the end user's experience. To get a Silverlight app running outside the browser, users first need to visit the app in the browser and then right-click and select "Install app onto this computer."
Adobe's paradigm - just download an application and double click the icon - clearly has the edge when it comes to user-friendliness, but Silverlight is getting there.
It is possible to create a Silverlight app that detaches from the browser somewhat like a traditional download, but you'll need to create your own interface and then call the Detach() method on the Application type - or so the documentation informed us. Sadly we were unable to get our app to install on the desktop using this method.
Still, while there are a few bumps, the new out-of-browser capabilities may well end up being Silverlight 3.0's most important new feature. With the massive developer base of .NET I fully expect to see an explosion of desktop-oriented Silverlight apps once version three is out of beta.
In my time working with Silverlight I found development to be fairly easy and in many ways much more flexible than Flash - and that's coming from someone with eight years of ActionScript experience.
The framework is well documented and thanks to the .NET back end, there's no shortage of developers available to build Silverlight applications
Comparing Flash and Silverlight has already ignited many a flame war, but the truth is - as of Silverlight 3.0 - the two are equally capable and the one best suited for your project is really something only you can decide.
I wasn't crazy about the idea of needing a new plug-in, especially one from Microsoft, which doesn't have the best track record with web technologies. If developers can take Silverlight where Microsoft is clearly hoping they can, though, then we better get used to the idea. ®