I was in Belgium and The Netherlands this last week presenting and talking to folks in the community. After I presented on ASP.NET MVC 3, HTML5 and jQuery, one fellow came up after and said, "Should I use Silverlight or HTML5. I don't understand what Microsoft's strategy is or what to use in my app."
Since I work for the Web Platform and Tools team (ASP.NET, IIS, etc) I spend a lot of time working, coding, and thinking about the web. However, I'm not an official strategist, or marketing guy. But I do have an opinion; one that is mine and no one else's.
That said, I don't think it's that hard and I'm surprised there's so much confusion about this (both outside and inside Microsoft.) Companies have their official positions but then there's the realities of the web. Here's what the young man asked me and what I told him.
NOTE: I'm talking only about Silverlight in web browsers, not Silverlight for Phone, Games, Out of Browser, High Trust, and other environments that are uniquely Silverlighty.
Should I use HTML5 or Silverlight in my Applications? If you're embracing jQuery, where does Silverlight fit in?
Even though browsers like Chrome release and update very often, not every company is going to upgrade all their browsers every week or even twice a year. Some enterprises will be on Firefox 3.6 for a while longer, or (hopefully not) IE6. Browser plugins like Silverlight and Flash can add new functionality faster. They are called plugins for a reason. They plug-in and add something.
HTML5 isn't 100% done, but today it's already a collection of things that can be used now. Your web apps should use techniques like progressive enhancement to detect available features. As newer browsers include useful features like geolocation and video that used to require plugins, then older plugins become unnecessary. Plugins rev and add new more advanced features like DVR-like video and hardware-accelerated 3D. Those features will eventually find their way into browsers in a few years and the cycle will continue.
Silverlight 5 will become Silverlight 6, Flash 10 will become Flash 11 and HTML5 will become HTML6. Each new spec will add new features, innovating, and pushing the others forward . The web will be pushed forward by all these and more.
There's no question that advanced media apps, 3d, DVR video scenarios shine on Silverlight. Silverlight CAN do some things that HTML5 can't.
If you are creating an application for the web that needs images, links and text boxes, some animations and interactivity, there's no reason you shouldn't use HTML. With new JavaScript libraries like Modernizr, jQuery along with Polyfills, you can even use many HTML5 features and still have good functionality on ALL major browsers - not just the most recent generation.
If your application is internal or a line of business app and is what I call a basic "text boxes over data" application, you have a few choices. You can certainly use Silverlight and its databinding features, or you can use JavaScript libraries like KnockoutJS and write it in HTML. It depends on where you and your company's core skillset lies. Both are good choices and both aren't going anywhere.
If Silverlight has a feature that you need that isn't a part of mainstream browsers, consider a web app that is both HTML/JavaScript and Silverlight. I'm consistently surprised that people feel the need to make Silverlight apps that fill the entire browser but consist of mostly text, images, links, etc. Don't try to make Silverlight act like it's HTML. It's not. Plugins are complimentary to the web, they are not the web. Use them in complementary ways to make the best experiences you can.
If you need basic video like YouTube, use <video> tags if your browser supports the codecs you need, and a plugin if not. However, if you need live video, adaptive smooth streaming, DVR functionality, H.264, or other features that aren't part of HTML5, then again, use a plugin.
Also consider your own productivity and happiness and the tools you want to use. Think about your users, your dev team and their overall happiness.
Apps in C and C++ have their place in games and uniquely native scenarios. Apps using managed languages and XAML balance easy development and deployment flexibility. Apps in HTML and JavaScript work everywhere on the web. Perhaps one day we'll be able to easily mix and match these styles in the best of all worlds.
Until then, it's simple. Use HTML when it makes sense to your solution. Use a plugin when it provides unique functionality. Rinse, repeat. Apply common sense, and a little hair gel.
© 2011 Scott Hanselman. All rights reserved.
No comments:
Post a Comment