The Immediacy of Now - Why I'm Switching Focus to SilverlightSubmitted by smartyP on Sat, 05/16/2009 - 14:26
For those that don't know, I have been a Winforms dev since about 2001. Before that time I was just as interested in graphics and usability as I was in coding itself. While in college I was pursuing a computer science degree in class, but my free time wasn't spent coding in Java or reading books on operating systems, it was spent in Photoshop and Flash 4. In fact, I was doing more advanced stuff in Flash Actionscript at the time than I was doing in my college CS courses. I had hoped that when it came time to graduate from college I would be able to get aboard the Flash bandwagon - creating super cool UI's for the web - unfortunately the dot com bubble burst, and my coding abilities were what kept me gainfully employed.
Up until creating an entry for the Server Quest Silverlight contest I had never touched Silverlight. I was definitely aware of it, but I was a Winforms guy, not a web guy - so I was elbows deep learning WPF and Prism and doing WPF LOB work for my current employer - I had no plans of touching Silverlight. Now that I've finished my first major Silverlight app, Matchingo, I find myself questioning which direction I want to go next - do I go back to WPF, or do I keep on trucking in Silverlight?
(click 'Read More' below to keep reading)
After repaving with Win7 RC two weeks ago I installed all my necessities like VS2008, Blend, Evernote, Paint.NET, but I forgot to install another favorite - Launchy. I mention this because it took about 10-15 times of trying my Launchy shortcut unsuccessfully before I finally took the time to go and install it. Now Launchy doesn't have a difficult install or anything. It doesn't have any intricate dependencies either, it's literally a 5 second download and a 5 second install - that's it. Even though Launchy is one of my favorite apps and only takes 10 seconds to get installed, I put it off in favor of just using the Start menu - something I had immediate access to - that is how lazy I've gotten when it comes to my needs for instant gratification when working on my PC - and I must assume that I'm not the only person like this either.
I have to wonder if Matchingo had an install, how many people would've bothered to download and install it? How about if they needed to download and install .Net 3.5 too? What if it only ran on Windows? How many hurdles would have been put in front of someone if Matchingo were in WPF and not Silverlight? And how lazy are typical users when it comes to getting the instant gratification of running something right now, not once they get it setup and running?
Matchingo was written in Prism, just like the WPF apps I had been playing with. It's written in C# too, just like the desktop apps I've been writing for the last ~6 years. Sure Silverlight has less functionality than WPF, and there are definitely plenty of reasons why someone would chose WPF over Silverlight, but what makes more sense for me - focusing on WPF, or Silverlight?
(now you can see my fire demo with no download or install - how convenient)
You might recognize the fire demo above from a previous post Old School Fire Algorithm in Modern Day WPF. The primary differences being that the one above doesn't require a download or an install, is a little bit less performant, and is in Silverlight instead of WPF. In porting the code there were several things I had to do different - there is no Adorner, nor BitmapPalette, nor DrawingContext in Silverlight, so that meant some pretty breaking changes in the port - it also meant some pretty significant performance drops for this kind of manual draw. Had the port been from Silverlight to WPF instead it would have been much easier, mostly because Silverlight is typically a subset of WPF, but it would've come with some performance costs.
When I started in WPF I had heard many say that "you should start with Silverlight since it's a smaller footprint, then move to WPF", but from my perspective I thought "why limit myself to a smaller subset, I'd rather have all the functionality I can get". Well, now I know why - because Silverlight gives me more instant access to more people, and that in turn increases the chances that someone is actually going to look at what I created.
In comparing the benefits of WPF or Silverlight I have to factor in the chances that a general audience can actually use what I have written - that the user has the minimum requirements of my app. The absorption rate of Silverlight is roughly 25% right now according to the estimates I've heard. I would love to know some numbers on the absorption rate of .Net 3.5 SP1, but I would have to imagine that the numbers are roughly the same. It's how easy the user can meet those requirements where Silverlight comes out way ahead - both in download size and install time as well as the operating systems which they can use.
So, in short (not really) I have decided that my personal time will now stay on the Silverlight path and not go back to the WPF focus which I had up until recently. I will of course still stay up on WPF developments, and will likely still do some WPF work professionally, but as for my personal work I will now be aboard the Silverlight bandwagon.
Here is a summary of the main reasons why I will now pick Silverlight as a primary focus over WPF:
- The Silverlight installer is under 5mb, around 10x smaller than a typical .Net 3.5 install
- Silverlight has multi-platform support
- Silverlight code typically ports to WPF easier than WPF code to Silverlight
- Silverlight apps require no download to run them (once reqs are met)
- Silverlight apps require no installation to run them
- Silverlight apps can run in the browser (and soon out of the browser)
- Silverlight supports a majority of the same technology as WPF (Prism, unit testing, etc.)
Like I said earlier, there are plenty of reasons why someone would want to write a WPF app instead of a Silverlight app. WPF doesn't have to play in a neat little sandbox, and as such it lends itself to LOB apps in many cases in which Silverlight wouldn't make sense like hardware device interaction, etc. But chances are that anyone who is looking to move into a new UI technology is going to target Silverlight if they can get away with not needing the extra functionality that WPF affords. In those instances where you do have to go with WPF, virtually all the experience learned in developing for Silverlight can translate over to WPF - so for me, Silverlight is the way to go for the immediate future. Now I can finally invest in studying an RIA platform without risking losing the LOB knowledge which typically pays the bills.
I've got the same
I've got the same feeling.
About 1 month ago I was architecting a new project, which is a realtime trading system. Initially I abandoned Silverlight 2 and chose WPF. After Silverlight 3 came up I quickly change the direction of the project to using Silverlight 3. The offline function of Silverlight 3 has really won my heart.
Besides, I really wish Silverlight to be able to run a managed, embedded SQL database inside the isolated storage so that I can make the resync to the server side a little easier. Currently I am serializing collections into files at periodic checkpoints that is less reliable than an SQL database which has update logging.