I was going to present an analogy using different types of cars, but more often than not, the analogy breaks down on some key point or carries some baggage that just doesn’, and folks start picking apart the analogy and assuming it still applies to the real discussion. The only way to get a perfect analogy is to just talk about what you’re talking about :). So anyway…
Why is it ok to bark about the Microsoft desktop "monopoly" and then say Flash is great because it has 95% browser share? I call shenanigans. There is more than enough room in the industry for both Flash/Flex and Silverlight (and others) -- neither one should need to be a monopoly to succeed.
Lately, I’ve seen a lot of Flash vs. Silverlight posts on various sites. (To the person who thinks this is just about your post, it isn’t <g>). I usually do my best to stay out of those, because I think the “vs” story is too deep for any one person to accurately portray, but once in a while, I step in. Plus, once you’ve invested any amount of time in one of the technologies under discussion, you completely lose the ability (or at the very least, the perceived ability) to look at the comparison objectively.
It upsets me when I see folks gush over one technology by trashing the other. It makes it next to impossible to take any of their other arguments seriously. Silverlight and Flash/Flex are both very good, very capable development platforms. Both have a lot to offer. It’s not like one is crap and the other is great. It’s also not like either of the two companies can claim corporate sainthood.
For each project at each company, you have to ask yourself which technology is right for that project and that team. You may find, for example, that the RIA you’re building is a great target for Silverlight, but that ad that everyone must see when they hit your site really should be in Flash. You may find that having a house full of .NET developers leads you to naturally pick Silverlight for the productivity gains, or that the asset pipeline in Flash is just right for your creative folks.
That said, just because your shop uses Adobe tools for graphics design doesn’t mean it has to use Flash for RIAs – you can pull in your PNGs and JPEGs from Photoshop, and export your Illustrator files to xaml (either using Expression Design or using Mike Swanson’s XAML exporter) You don’t need to completely retool to use Silverlight. Nor would you want to; Adobe clearly has the upper hand when it comes to the bitmap and vector design tools.
I’ve spoken with some really smart folks who work with Silverlight, WPF, Flash, Flex and AIR every day, and they have good and bad things to say about both Silverlight/.NET and Flash/Flex (don’t trust anyone who has only good things to say about any specific technology because either they don’t use it enough to hit the warts, or they have too much invested in that technology to notice the problems). These are the folks that understand that there is more to the picture than a religious war.
So, without doing a comparison with Flash and Flex, despite the title of this post, here are some of the things I do and don’t like about Silverlight. Sure, there are lots of things here you can do in both technologies using different approaches (I consider the basics of LINQ to fall into that bucket), but this isn’t about that. This is just a list from someone who has Adobe CS3 installed, but who hasn’t done anything with Flash other than the most basic things.
What I Like about Silverlight
- Subset of WPF. WPF is the premier windows desktop UI technology, bar none. You can build some amazing applications in WPF that were either not possible, or took too much effort in the past using mashups of windows forms and GDI+ and DirectX/OpenGL. I love that Silverlight is a subset of WPF and that the skills (and most of the code) transfer between the two.
- .NET. When I code on the server, I use .NET. When I build desktop applications, I use .NET. Now I can code in the browser using .NET. When you can use the same tools and languages to develop across target platforms, you gain an incredible amount of productivity.
- The Xaml editor in VS2008 is great. Intellisense (introduced in VB5 CCE, I think Intellisense is second only to syntax highlighting for making it easier to code) makes learning Xaml a snap. I’ve heard a lot of complaints about the Xaml editor, but it has worked well for me for some time.
- Services are simple to use in Silverlight. From my discussions with other people, the idea of “just add a reference and the proxy is autogenerated” is pretty foreign in other development platforms. In the MS world, we just take this for granted.
There really is a ton more I like about Silverlight, but I don’t want to bore you with a gushing love poem :) Suffice to say that there is a lot more I like about Silverlight than dislike. I wouldn’t have dedicated all my free time (and most of my work time) for the past year and a half to it if I felt otherwise.
What I Dislike (or “My Silverlight Complaints and Wishlist”)
I’ve been writing production Silverlight applications since the 1.1 alpha (I mostly skipped 1.0), and as you can imagine, I have a few things I dislike and a few things I’d like to see implemented in the runtime and the tooling. The various Silverlight and tooling teams have done an amazing job getting as far as they have, but the job’s not done yet.
- Audio playback for short events and loops. The audio playback mechanism in Silverlight doesn’t currently work well out of the box for event sounds (think gunshots in a game) and looping tracks (like background music in a game). There are workarounds for all of these things, but I would like to see support for this baked right into the platform. Supporting wav files would be a really nice addition here. The ability to create a stream and just have the audio processor play the bytes would also be extremely cool.
- Business Application Starter Kit/Template. Once some of the things below are addressed, I’d like to see Microsoft (or the community) create a set of VS templates for standard bizapp scenarios. Similarly, I’d like to see a VS wizard to convert a Silverlight app to WPF Xbap or v.v.
- Browser Networking Limitations. The browser imposes some serious restrictions on networking. The most annoying to me is the number of available simultaneous downloads. When you’re downloading thumbnails and queuing up video at the same time, you can run into non-fatal but annoying problems where some content makes it and others fail (presumably a time out) without any real warning.
- Lack of Call-Based Security. I’d really like to see some support for passing credentials with service calls. This will help make Silverlight a true SOA-aware client. Granted this is more often useful for inside the firewall use-cases, but I get asked about this all the tame. While I’m at it, let’s have SOAP faults and some of the WS-* things that make the current services implementations so much more robust than they used to be.
- Cross-Domain File Needed for RSS Feeds - Yuck. While I understand the underpinnings of this (How on earth would Silverlight know you were retrieving an RSS feed unless it already retrieved it), it is annoying that the vast majority of blogs are inaccessible to Silverlight and Flash. You might say “well, just stick a client access policy up on the server”. Well, Eugene Osovetsky has given me a good wake up call on why that is a bad idea, and I finally get the problems there. Basically, you don’t want to have this file opening up html forms for cross-domain access, or the app could spoof you, access your cookies etc.
- Current Xaml Design Surface in VS2008 is bad. It’s read-only for the moment, but suffers from numerous beta problems like choking my machine, crashing the IDE, failing to render content etc. I expect this to be fixed by RTM (it has improved with Beta 2), but it is a problem right now. Blend will probably always be the design surface you want to use, but sometimes I want to just stay in one tool for more than a few minutes :)
- Text Performance. Text performance in Silverlight isn’t that great right now. I expect some of it to be resolved in RTM, but right now you can take a serious hit if you animate something which has text in it. Most users won’t notice unless your app is overloaded with text, but I do.
- Lack of Bitmap API. If you have a programmable bitmap API, and the ability to render Xaml to a bitmap, you can create just about any effect you might want. I’ve seen some cool implementations where PNGs are created on the fly, but that’s not quite what I want. Bitmap API will also make games much easier to write.
- Per-Frame Callback. Another thing I’d like to see. Sometimes the app your writing will fight with Silverlight when it comes to rendering. This rarely happens on regular RIAs, but I was writing a Commodore64 emulator and felt the pain of both the lack of callback as well as the lack of a bitmap API. Granted, in a retained-mode system, you shouldn’t need this. However, sometimes Retained Mode isn’t quite what you need to solve the particular problem you have.
- Offline Support. I love WPF. I think it is really the best choice when it comes to building an offline or occasionally connected application. (It’s also the best choice if you are targeting only Windows users). That said, the ability to write a cross-platform application so that it can be dragged off of a web page, or actually installed with an icon and the usual flare, is very appealing. I don’t consider this the blocking issue that many make it out to be, but I think it is important from a competition standpoint at the very least.
- Client-Side Validation Framework. ASP.NET has validator controls. Silverlight needs something similar (ideally integrated with Binding) to make it easy to roll your own client-side validation display / notification using a standard framework. This is something that can likely be added on, with some sort of decorator model for the controls themselves.
- Windowing / Navigation Model. For folks building fairly standard business applications, the lack of a window or navigation model is one of the first hurdles they must jump. I’ve done a little bit on my own with event bus and navigation patterns, but there can definitely be more done in this space. I think this would be a great CodePlex project as I believe the majority of the infrastructure is already in place.
- Uniform Configuration Model. The clientconfig used for the WCF client is useful, but I’d like to see a regular app.config model that includes everything. Right now, on deployment, I need to tell folks to modify multiple configuration files to set production service endpoints as well as other production variables. Sure, I could hand-code the config file and feed that into the WCF client, but I’d prefer to see something uniform across all types of configuration in the application.
- Better Codeless Prototyping (or more in Xaml). Right now, a designer has to do a fair amount of code to visualize a Silverlight application. Some of that has to do with binding, some with triggers, others with commands. I’d like to see Silverlight allow for more of the functionality to be defined using Xaml, so a designer can mock up the application without having to understand C#/VB/whatever.
- Intellisense on Style Setters. I have no idea how you’d do this, but the string-based nature of the style setters makes mistakes both easy and common (and they can be extremely hard to track down). I’d like to see some intellisense on setters in styles and templates.
- Bitmap Fonts. By the time they’re implemented, they may be out of style, but bitmap/pixel fonts can look really good when you’re using small text for labels or whatnot. The fonts in Silverlight tend to get a bit mushy at small sizes, although I understand there are some potential fixes on the way.
- Alpha Channel Video. It would be nice to be able to play alpha video over the rest of your UI when building assistants and just plain cool effects. Think a video of a person walking across your UI pointing out things, without the UI being stored in the video.
- Non-Affine Transforms. or “Simulated 3d”. I’m not sure that I need full hardware-accelerated 3d, but it would be nice to do something like coverflow (or whatever comes next) without having to deal with stitching.
- Binding to Anonymous Types. I understand the issues here related to reflection and security, but you lose some of the power of LINQ if you always have to create strong types to hold the results in order to allow binding.
- XPS and Printing. I’d like to see these implemented together so we can create real reporting solutions in Silverlight. This isn’t a show-stopper, as there are ways to print HTML, but this would be a nice to have for many applications. I don’t print as much as I once did, but I do print diagrams, maps+directions, and even the occasional report.
- An RTF/HTML Rendering Control. This goes more to text manipulation. There are free third-party solutions available for RTF/HTML rendering, but I’d like to see Microsoft create a robust one that could be used for RSS readers, mail clients etc.
- TextBlocks with Selectable Text. I’m putting this one on here as the last item, because I go back and forth on it. We’re used to desktop applications where you can’t select the text, but when something’s in the browser, you just naturally want to copy/paste text from it and into other apps. Not a deal-killer, but a nice to have. You can work around this with read-only textboxes, but those don’t support some of the same features as TextBlocks, and have other overhead.
Oh, and anything unique added here must be back-ported to WPF to maintain compatibility :)
Things I Consider Non-Issues
Here are some common complaints/concerns that I personally consider non-issues because of the types of applications I typically build, and the discussions I’ve had with other community developers. Note that I don’t represent the team or Microsoft, so just because I don’t consider something a big issue doesn’t mean they’ve written it off or have a similar opinion.
- Lack of GIF support. Most folks moved away from GIF when the whole unisys patent lawsuit came out. The alternative offered was PNG, an open format that supports a lot more than what GIF ever could (with the exception of animation, but the web has far too many animated GIFs as it is). When Microsoft was slow to support alpha channel PNGs, everyone complained (me included) that they ignored the new standard in favor of some outdated. Now that Microsoft has a technology that supports PNGs rather than GIFs, there are complaints there too. Yuck. Give up your 256 color GIFs or use a server-side proxy to convert them to PNGs if you must. I guess if you’re just displaying images from other sites, this could be an issue for you, but I haven’t run into that myself.
- Lack of support for FLV (flash video). I can see how supporting FLV would be nice, but is it really necessary? In the long term, when both Flash and Silverlight reach similar levels of adoption, cross-support of proprietary video formats will probably not be a differentiating factor. I won’t complain if it shows up in the product some day, but I don’t see a compelling long term case for it. I do see a short term/transition case, but it seems a high price to pay for a transition technology.
- Inability to Elevate the Sandbox. I think it’s good that Silverlight is as locked down as it is. Microsoft always gets nailed on security (even when it is not their fault). They took the right approach here and decided to release Silverlight in a tight state and then look at places where it can be safely extended later.
- Asynchronous Networking. I think async is a good thing. I also posted an entry on how to chain networking calls if you need to take an action after some specific number of them complete. I will admit that allowing sync calls from a background thread would be a nice touch, but I’m glad they aren’t allowed from the UI thread.
- Small Control Set. This will be fixed by the community, by Microsoft and by third-parties. I remember back in the early days of VB when the out of the box control set was really small. We always had to turn to overpriced VBXs (later OCXs) to handle it. Given that history, Silverlight has a decent control set out of the box, and according to a post from Scott Guthrie a while back, more are coming. The third parties have also stepped up, some even offering their controls for free. Nice!
There are other, more controversial things, that I’m going to leave off for now (like PPC support) as I, like all of you, can only speak for my projects and my customers, and my colleagues.
What do you think about the two technologies? What’s on your Silverlight wishlist?