Tuesday, February 23, 2010

Top 10 Silverlight Myths and the Facts to Bust Them

Silverlight is a client side plug-in based technology that has been in production since late 2007. I've been a web developer for well over a decade now, and recently have focused almost exclusively on Silverlight since version 3.0 was released. It astounds me how many people still resist Silverlight because they either don't understand what it is or haven't taken the time to research the capabilities it provides. Silverlight is a strong, mature technology that is being used on production sites to deliver powerful applications right here, right now. It's not emerging and it's not experimental.

From my experience answering questions about Silverlight on both Twitter and various forums and discussion groups, I've come up with ten common myths that I hear of over and over again. My hope is this one post can serve as a central place to address those myths, provide the facts that bust the myths, and help potential Silverlight users and developers better understand and take advantage of what I consider to be amazing technology. Feel free to share your thoughts in the comments at the end of this post and share this link with anyone who will gain value learning about the truth!

Myth: "Silverlight is mainly for video."

Fact: Video is only the tip of the iceberg.

Silverlight is a cross-browser, cross-platform, and cross-device plug-in used for creating rich applications on the Internet. In addition to a powerful video stack that makes it easy to deliver video using most of the widely available codecs, Silverlight also boasts a powerful client networking stack (making it easy to connect to third-party services like Facebook and Twitter, using SOAP, REST, or even raw TCP sockets). It has a robust data access model that uses a concept known as data-binding to render data. This makes it ideal for line of business applications due to the relative ease of taking business classes and exposing the data through a rich, interactive user experience. Silverlight also boasts a very robust layout and styling engine and comes with literally hundreds of controls and behaviors ready to be integrated into your applications.

To see what's possible with Silverlight, take a look at the Silverlight Showcase. For an example of how Silverlight provides an effective "line of business" experience, check out Microsoft's Health CUI Patient Journey Demonstrator. Here is another list of 25 inspiring Silverlight projects.

Myth: "Silverlight requires Microsoft web servers to run."

Fact: Silverlight applications can be served from any web server that supports configuring MIME types.

Silverlight is packaged into a file called a XAP file. This file is actually a special zip file that contains the content necessary to run a Silverlight application. Because this content is completely self contained, there are only two steps required to successfully run the application: first, the server must provide the content to the end user via their browser, and second, the browser must load and run the content via the Silverlight plug-in.

Take a look at Embedding Silverlight in PHP. If you wish to host the Silverlight application on a server such as Apache, you simply need to store the XAP file on the server, and add the MIME type for the extension .xap of application/x-Silverlight-app and the user's browser will do the rest!

Myth: "Microsoft tools for Silverlight are expensive."

Fact: You can develop fully functional Silverlight applications at no cost.

Actually, you can grab everything you need to develop Silverlight absolutely free. Take a look at the Silverlight Get Started page. There, you can download everything you need to build fully functional Silverlight applications. There is an SDK, toolkits, extensions, and even links to helpful tutorials to get started. While there are trial versions of additional tool sets such as Expression to help you get started, these are not required to build your applications.

Are you more of an open source person and prefer a different IDE? Check out the Eclipse Tools for Silverlight, an open source IDE that allows Java developers to build Silverlight applications.

Keep in mind the SDK works perfectly well with the Express (free) edition of the Visual Studio IDE that is available for download here. You can grab the 2008 edition for Silverlight 3 development and the upcoming 2010 for future Silverlight 4.

Myth: "Silverlight doesn't work on ... (Mac, Chrome, etc.)"

Fact: Silverlight is supported on all of the most popular browser and operating system combinations.

This is a common myth. Silverlight support is broad and while there are some obscure combinations that are not supported yet, all of the major used browser and platform combinations are supported.

According to the W3Schools Browser Statistics, the top three browsers are Internet Explorer (versions 6, 7, and 8) followed by Firefox, Chrome, and Safari. Opera trails at 2.2% of the market.

The top 5 browser operating systems are all Windows operating systems which account for 90% of browsers that visit the website. Mac commands 6.8% and Linux 4.6% as of January 2010.

Based on these statistics, Silverlight is supported on the major operating systems and browsers (FireFox, IE, and Safari). While there is not official Microsoft support for Chrome until Silverlight 4, most report it runs just fine in that browser as well. The plug-in is supported on Intel-based Macs for both Safari and Firefox. While there is currently no Linux support, the Moonlight project is working toward that goal with Microsoft's full blessing. There is no PowerPC support for anything other than version 1.0, but the majority of Mac computers are Intel-based according to this chart.

Myth: "Silverlight is buggy."

Fact: Silverlight is in its third version production release and is used in many production websites without issue.

This is one of those claims I believe comes from two sources: people who simply don't want to install or play with Silverlight, so they call websites "buggy" when they can't access them due to lack of the Silverlight plug-in, and people who don't understand the difference between a buggy framework or plug-in and bad code.

Like any other platform, Silverlight is simply a staging area for applications. It's up to the development community to write those applications. Some developers are certainly more skilled than others. So far I have yet to find a viable production "bug" related to the Silverlight runtime itself (as opposed to errors or bugs introduced by the developers). That doesn't mean they don't exist, but I haven't found it and I've written and supported a lot of code.

If you're concerned about how stable Silverlight is, consider this: it is robust enough to power Sunday Night Football, the 2008 Beijing Olympics (yes, that was two years ago) and the 2010 Winter Olympics. Artist Alicia Keys used Silverlight to stream her "Live from the Apollo" concert.

More importantly, there are a host of companies, including Fortune 500 companies, that use Silverlight every day to drive critical business operations. As an example, read about how my company, Wintellect, worked with a financial solutions provider to build a web-based check deposit solution using Silverlight. Then click here to launch a Bing search that shows several more case studies for your review.

Myth: "HTML5 is going to kill Silverlight."

Fact: HTML5 and Silverlight are different technologies that provide solutions to different problems.

This is a common topic of conversation on the web. Due mostly to the myth that Silverlight is only for video; the fact that many web browsers are adopting the new <video> tag, and major sites like YouTube are now supporting the standard, has led some to believe that both Flash and Silverlight are going away.

This couldn't be farther from the truth. According to several tracking sites like RIAStats.com, the adoption rate of Silverlight is growing dramatically. Meanwhile, some browsers have adopted certain portions of the HTML5 standard and tout their support of "open standards" despite the fact that HTML5 isn't actually a standard yet. Take a look at the W3C schedule for this. It won't even be an official recommendation until 2012, and isn't expected to be finalized until 2022. I'm not making this up, read the facts for yourself!

So as much as the dream is alive, any adoption now is not support for open standards, but premature support for draft standards that are subject to change.

Don't get me wrong, I'm not against HTML5. I think it is fantastic. But what HTML5 does is provide advanced markup for media. Silverlight, as you've read in this post, does much more than provide pretty graphics or stream video. For more on this topic, read Why HTML5 won't kill Flash or Silverlight.

Myth: "Silverlight is about smashing open standards."

Fact: Silverlight is a platform that functions in addition to, not against or contrary to, open standards.

In a previous myth, I mentioned how slow the HTML5 ratification process is. However, there are browsers pushing support for features and I'm not saying that is a bad thing. In fact, Silverlight doesn't conflict with these standards. The latest version of Silverlight, version 4, that will soon be released has full support for HTML and rich content. This means it can host HTML code and even execute JavaScript and plug-ins within the application. It fully supports the open standards used to render web content.

One of main arguments that Silverlight is "against open standards" is because of the video support. Opponents say that the HTML5 <video> tag is the way to go. While this sounds good in principle, there are a few issues with it. While the tag is adopted in several browsers, currently it is mainly good for simply playing, stopping, starting, and pausing videos. There is no built-in support for captioning (take a look at this article to see how difficult it is to even attempt captioning using HTML5). There is no support for adaptive streaming technologies (like IIS Smooth Streaming) which improve the user experience by degrading gracefully to lower bit rates when the network slows, rather than stopping the video and showing the annoying "buffering" icon and forcing the user to wait 15 seconds.

Silverlight makes it easy to provide videos with rich content, including chapter navigation and support for captioning. Furthermore, with the full DOM support, it is also easy to fall back to other video rendering methods. In a recent project I worked on, I built a Silverlight control to play videos in a PHP page. I used JavaScript to detect if the user had the plug-in installed. If not, I'd simply launch the direct video instead so that it could still be played on browsers that don't support Silverlight.

To further complicate the matter are dubious claims on the web about "open standards achievements" that, well, aren't really "open." Take a look at the world's 1st HTML audio generated music (their claim, not mine.) It sounds great because it is entirely open standards, right? Then why are they showing it with a video clip instead of making it play in your browser? The kicker comes in the "try it yourself" section, where you find out you need a custom "audio write enabled version of the FireFox browser." That hardly sounds like an open standard to me. I don't need a custom browser to run my Silverlight applications that handle audio and video just fine!

Again, I believe the main reason for this myth is really the perception that Silverlight is only good for playing videos and therefore is somehow competing with the HTML5 specification. Once you realize there is much, much more that can be done with Silverlight, you'll realize it is a way to get things done now, instead of having to resort to exotic JavaScript hacks or waiting for the open standards to catch up.

For another example of just how powerful the Silverlight experience can be, take a look at Bing Maps and zoom into the streets of Seattle, Washington. While zoomed in, click the little blue person to go to the street level view. These types of experiences just aren't possible with the current "open standards" and therefore provide an immediate solution until the standards can come to terms with technology advances.

Are you still holding out on installing the plugin? You can view the Bing Maps experience in a video posted at TED. This one, by the way, is streamed using the most popular "standard" for showing video today: the completely proprietary Flash plug-in that was produced not by an open standards committee, but a corporation called Adobe. (It's an interesting fact that the people who are extremely vocal about HTML5 being the video standard still watch most of their videos using Flash ... only recently have a few major websites such as YouTube actually adopted the "HTML5 standard.")

Myth: "It's hard to develop for Silverlight."

Fact: Silverlight is based on the Common Language Runtime (CLR) and can therefore be written in multiple languages.

There is no need to reinvent the wheel. .NET developers will find native C# and VB.Net support. While the XAML markup language comes with a learning curve, most people admit that it is a powerful tool and the time to master it well worth the experience it provides. Silverlight can be written using IronPython, and I've already mentioned the project to make it available to Java programmers.

The learning curve is no greater than most other languages and I would argue as a framework it is vastly superior for web programming. One of the reasons I began building Silverlight applications was because I could create richer real-time applications with better performance in a faster time frame using Silverlight over traditional HTML plus JQuery web pages. I didn't have to write exotic solutions to maintain state between page calls or support multiple browsers. Once you write the code, it runs wherever the plug-in is supported. The data-binding and XAML markup make it incredibly easy to develop very complex user interfaces in a short amount of time featuring full validation.

The IDE for Silverlight supports features such as drag-and-drop behaviors and tons of widgets and controls. In the next version to be released, there is even drag-and-drop data access support. I don't necessarily consider this a good thing: the argument that it is difficult to develop is typically because it's something new to learn. Unfortunately, many developers have been spoiled by easy "drag and drop" frameworks that might build websites quickly while sacrificing some scalability, useability, and performance. Most developers who are used to building solid architectures find that Silverlight helps, rather than hinders, their development efforts, while the developers who depend on crutches like completely auto-generated websites based on database models will struggle with learning best practices for multi-tiered applications.

Community Feedback Links (see comments):

Myth: "There aren't good materials to learn Silverlight."

Fact: The Silverlight community is teeming with individuals and websites designed to help you learn it as quickly and effectively as possible.

One complaint I hear is that there aren't enough books out on Silverlight or various design patterns such as MVVM (model-view-view model) that are used in Silverlight. One of the issues is that the technology is moving at a very fast pace ... just a few years after launch, and we're moving to version 4.0 ... so the web is often the best way to get the latest information.

The main Silverlight site is loaded with tutorials to teach you how to write Silverlight, with topics ranging from basic to advanced. Then there are videos like Victor Gaudioso's on-line tutorials and the consistently updated Silverlight TV. The Silverlight Cream website keeps you up to date with the latest articles, tutorials, and blog posts related to Silverlight. Pose a question to the Silverlight Forums and you are likely to receive a response within minutes. Take a look at all of the Silverlight Users' Groups.

Need more advanced training? Our own company has in depth training available from Jeff Prosise's Silverlight Party to Silverlight for Designers and our flagship Devscovery Conference (we have a full day devoted to Silverlight in New York).

There is plenty of material out there if you are willing to read, watch, and attend.

Community Feedback Links (see comments):

Myth: "There aren't many practical Silverlight applications."

Fact: Silverlight is right here, right now, with satisfied customers using production applications to streamline business process, provide a media presence, offer gaming experiences, and more.

This is by far the main myth that is shattered by the others. Going from assuming Silverlight is "just for videos" to this is an important step in understanding what Silverlight can do. I've already mentioned the Bing maps experience, pointed you to the showcase of applications and the sample application Microsoft provides for healthcare. There are sites devoted to Silverlight games. You can view Darwin's field notes on-line and browse hardrock memorabilia. This is all in addition to the various line of business applications that are on intranets monitoring the health of servers, providing interactive interfaces to upload, transport, and archive data, and real time visual feedback for statistics businesses care about.

If I've appeared somewhat biased in my discourse on Silverlight, it's because I am. I've written PHP, AJAX, wired interactive sites with JQuery and used XML and XSLT as "open standards" to drive content-based websites. In all of my years working on the web, I've found Silverlight to be one of the most compelling platforms for creating truly amazing experiences both on-line and, with support from the newer releases, offline as well.

Having said that, I also don't believe Silverlight is the only programming platform. There are many cases where other tools and languages are required, whether it is because of the platform (i.e. a mobile device or desktop application), the content (for example, I wouldn't write a mostly text-based content management system in Silverlight), or the target audience. However, it's important that people understand what is possible so they don't get lost in pointless and irrational rants against technologies they haven't taken the time to understand.

Please share you thoughts and feedback below!

Jeremy Likness