I'm also torn on Silverlight in general and seriously considering rewriting the app from scratch in an HTML framework (debating between Rails and ASP.NET MVC, even if that debate may seem like a silly one to some :) )
I'm also torn on Silverlight in general and seriously considering rewriting the app from scratch in an HTML framework (debating between Rails and ASP.NET MVC, even if that debate may seem like a silly one to some :) )
Silverlight is an interesting beast. All in all I am finding it feels like writing a webapp in C# and a very strange "version" of HTML :) Especially when you use the Navigation Framework, the app becomes so website like it's ridiculous. I hate to think Microsoft wasted all that money, but I'm having a hard time coming up with Silverlight's strengths. Especially considering we are having issues with the Mac plugin, the promise of "write once" seems to not be met either. Granted it's two plugins versus half a dozen browsers (we don't support Moonlight at all), but still, if I'm going to be fighting how different platforms render my app, I might as well take advantage of the most ubiquitous and open platform there is.
I can admit XAML was well conceived for layout flexibility and visual effects. But at the end of the day, that benefit is so small it's hardly worth considering.
That's a long and tiring road.
Absolutely, C# is far more pleasant than JS and XAML is a nice alternative to HTML+CSS. All in all XAML was well thought out IMO. And since I'm knee deep in Silverlight right now, it's easy to forget how frustrating HTML/CSS/JS can be across all browsers. It's also easy to forget how difficult it is to test JavaScript code.
My problems with Silverlight are:
-- I really don't think it's going to become a dominate player, making my investment in Silverlight skills not nearly as effective as if I had taken this time to continue brushing up on my webapp abilities.
-- It has its own CLR, making a lot of the .NET tool stack incompatible. There is still not an ideal way to test Silverlight components and especially no ideal way to integrate tests into your build tools. Silverlight is waaaaaaay behind here. There is a lot of people out there trying to solve this problem, but so far all the solutions (I've tried most of them) have serious drawbacks. Jeff Wilcox's Silverlight test framework is the best one so far, but it's very slow, cumbersome and buggy.
-- Silverlight is incompatible with mobile devices. I have no hope of ever making this app work on the iPhone, Android or Blackberries. I suppose there is hope it will work on a Windows 7 Phone, but that's not enough. My Boss doesn't think this will ever matter to us, I'm not so sure. If we ever do decide we want a mobile version of our app, then at least the frontend of it will have to be completely rewritten from scratch.
-- Absolutely everything in Silverlight is asynchronous. This isn't a real problem, per se, and is a good boon sometimes, but there are times when it's a pain in the butt.
-- We have found the Mac Silverlight plugin and the PC Silverlight plugins have significant differences. Currently our app has serious flicker issues when ran on a Mac. We're not doing anything hacky, home brew, anything like that. The stuff that looks bad on the Mac is pure Silverlight code the way Silverlight was intended to work. I simply think the Mac plugin has more bugs and is a lower priority. I have no idea where Moonlight stands, but I have a feeling similar issues would occur. If I have to fight to get my app to run across all Silverlight plugins adequately, then IMO a major selling point of Silverlight is gone and I might as well just use HTML and fight to get it to to work across all browsers. At least dealing with browser issues is a common problem with a lot of solutions out there (a framework like Rails will even hide a lot of it). Dealing with Silverlight plugin issues? My only resource is the Silverlight forums and Microsoft Connect. I'm not nearly as hopeful there.
-- We are forced to use the Microsoft stack. Yes you can host a XAP file in Apache on Linux, no problem. But if your Silverlight app needs to work with data, there's a very good chance you are going to choose WCF RIA Services (which we did). Bam, use IIS to host the app now or take the gamble with Mono. Not a gamble I want to take. I much prefer Apache over IIS.
-- And ultimately, my real problem is as I write this app I just don't see any huge compelling features of Silverlight that makes all this worth it. Just about anything Silverlight can do, an equivalent modern webapp can do as well. Yes Silverlight does allow you to do this from the comforts of Visual Studio, C#, Blend and XAML. Much nicer waters to swim in than JS, without a doubt. But I just don't think I care. I think I'd rather deal with the current state of HTML/JS/CSS and end up with an app that potentially could be used on any device (within reason), can be hosted in Apache running on Linux, and can be a far lighter experience for the end user to boot.
Flex is basically a really damn good system for UI coding and design, but the ActionScript that backs it up is pretty weak compared to C#. If I could mix C# with MXML I would be in coding heaven...
If you are working with RIA/WCF Services and the Entity Framework, if your app isn't straight up CRUD, data access gets a bit kludgey really quickly. The asynchronous calls from the client don't help.
I also agree with another comment that points out that there is little that Silverlight can do that a good JS-driven UI can't. We grudgingly moved to Silverlight because it allowed some degree of interoperability with our main product (which runs on PDAs and tablet PCs--data collection devices)--the web app will allow users to build UI flows for the devices, and thus we can use the controls already defined for the devices in the Silverlight app. I suppose that's one on of the selling points of XAML, but I haven't done enough work on the UI to make an informed decision about it.
-- HTML/CSS/JS cross browser issues are a huge problem. As a web dev I waste an INSANE amount of time dealing with them. Silverlight solves that issue (I've never seen the mac issues you spoke about though).
-- Javascript debugging is horrible. Firebug helps but it's not even close to using Visual Studio to step through a problem.
-- C# is a great language. I can use Ruby/Python/F# as well. The backend and the UI can both be developed in the same language.
-- It's a stateful environment. This one takes a mindset change but makes life so much easier than a stateless webapp. This one is huge IMHO.
-- XAML and the layout/databinding system are awesome. I don't need a phd in css and a pile of hacks to make a complex layout. Efficient and elegant layout are huge for productivity.
-- I like to unit test and it allows me to do model-view-viewmodel. Almost everything I write is testable and it feels elegant.
-- It's easy to make apps look good. The styling system is well done.
-- It's easy for ux challenged folks to make some decent looking animations and real ux guys can seriously impress. The animation system is awesome and Blend is a great tool for ux. The ux and animation support in Silverlight is something traditional webapps can't do.
Microsoft as a company deserves the bashing that it gets but it's developer division is top notch. Silverlight/WPF and the tooling to support it have a good lead on everyone else. I don't know that Silverlight will become a dominant player but I do think that people are underestimating windows phone. Silverlight/XNA are better than what Apple/Google are offering for mobile development. I also have a feeling that you'll see Silverlight on Android before long. Apple is going to be peering over there walls as Microsoft and Google pull away.
What are you using for testing? How well does it integrate with Visual Studio, how easy is it to debug a test, and how well does it integrate with your build tools? Silverlight's lack of proper testing environments is one of the biggest strikes I have against it. I'd love to rectify that.