Why use WPF if it is not RAD yet?

rad

I have been heavily involved with WPF for years now. When I first started out with “Avalon” it was hardly a blip on the .NET radar. After just a couple of years the crickets have been replaced by a rock concert, and the intensity just keeps growing. For a WPF geek, such as me, this is great news!

My numerous encounters with people using WPF have lead to me to conclude that the platform is finally gaining traction in the .NET universe. WPF has been picking up momentum for a while in the financial services world, in particular. I have also met quite a few people using WPF in the state/local government sector, the retail sector, entertainment sector, and quite a few others.

But, wait a minute…why are people moving to WPF? Visual Studio 2008 offers rather weak design-time support for WPF. The lack of drag-and-drop magic in VS2008 essentially kills any hope of the rapid application development (RAD) that so many software shops hold near and dear. Why are people leaving RAD for MAD (manual application development)? In this blog post, we will discuss why WinForms and ASP.NET developers have decided to move on to WPF. Note, everything in this post is based on discussions I have had with people, but is certainly not the “definitive” explanation by any means.

The most obvious reason that people are now moving to WPF is that Visual Studio 2008 natively supports WPF development without requiring any extensions to be installed (i.e. the Orcas extensions for VS2005). Even though the WPF design-time experience still leaves much to be desired, the fact that it is part of VS2008 is important for many software shops. Most companies simply will not base their software development on pre-release bits; and I do not blame them.

In the previous paragraph, I mentioned that Cider (the WPF designer in Visual Studio) leaves much to be desired. Compared to the high-productivity RAD tooling support to which Windows Forms and ASP.NET developers are accustomed, it might seem surprising that anyone would drift away into the not-so-RAD world of WPF. Let’s take a closer look at exactly what this means.

Moving from ASP.NET to WPF is not too radical of a shift (so I’ve heard), in terms of tooling. Both platforms involve a markup file with an associated code-behind file. In both ASP.NET and WPF, the developer expects to go into the markup file and tweak the tags by hand. The design surface can only get you so far. From a tooling perspective, the shift from ASP.NET to WPF is not as radical of a change as for WinForms developers.

For those of us who approach WPF with a strong background in Windows Forms, however, you are pretty much required to remove your brain from your skull, rotate it 180 degrees, and put it back in.

brain

This stems from the fact that WinForms developers are trained to never look at the designer-generated muck that is written for the Forms that they whip together in VS. The idea of working with markup that represents a UI is foreign to most WinFormers. Trying to move from a world where the serialization format used by Visual Studio to represent a UI is irrelevant, into a world where you are hand-coding XAML to get a UI together represents a significant mental shift.

This brings us back to the original question. Why are people moving to WPF at an increasing rate? I have heard several recurring themes when I ask people this question. Below I summarize each theme, and try to explain the rationale behind them.

Many people who moved from WinForms to WPF have told me that they are concerned about Microsoft gradually phasing out WinForms and concentrating their new developments and customer support into WPF. Many people feel that sticking with WinForms is just asking to be left in the dust. That is a very forward thinking idea, though I obviously have no idea how long it will be before WinForms is retired.

Another common theme I have noticed is that people are leaving WinForms for WPF because they want to incorporate advanced data visualizations in their programs. There seems to be quite a lot of interest in the possibilities of charts and graphs that a vector-based rendering system, which supports 3D, has to offer. Creating animated 3D data visualizations in WinForms is not exactly something that the average developer can do, but in WPF the barrier to entry is significantly lower. In my mind, that’s a very good thing (unless you happen to be making excellent money by creating advanced 3D data visualizations via GDI+).

The other common thread I’ve noticed is that people move from WinForms to WPF because they find certain aspects of the platform appealing. For example, many folks I meet tell me that the WPF data binding system alone was compelling enough for them to make the switch. I completely understand that!! From a developer’s perspective, things like triggers, routed events, rich data binding, and commands are extremely useful and addictive.

The last thing I have heard people say, but not quite as often, is that they want to have an easier way to involve a Visual Designer in their project. People who say that are typically working on a product, as opposed to an internal application for a company. For them, the idea that their aesthetically-challenged developers will not be responsible for designing the user experience is a powerful selling point for WPF adoption. Once again, I completely understand that! πŸ˜‰

The reasons why ASP.NET folks are moving to WPF overlap with the reasons listed above, for WinFormers. In addition, I have heard that some Web developers are just plain sick and tired of dealing with browser-incompatible HTML and CSS. I have met Web devs who originally got into Web programming because it made the deployment of their applications much simpler. They soon discovered that they traded the simplicity of development for simplicity of deployment. Pick your evil…

The other major reason that I hear of ASP.NET developers getting into WPF is so that they can get a jumpstart on Silverlight. Since Silverlight is planned to be a subset of WPF, many people find value in learning WPF now, so that they can apply that knowledge to Silverlight once it is officially released. I think that is a very wise plan.

What about you? Why have you started using WPF, or not? What are the key factors in your rationale for adopting or avoiding WPF?

34 Responses to Why use WPF if it is not RAD yet?

  1. marlongrech says:

    My company moved for WPF becuase DESIGNERS can do the UI and us DEVELOPERS can focus on the backend code…. I must admit sometimes developers need to tweak the UI but 70% of the time Designers do all the stuff πŸ™‚

    Besides that, WPF offers a very rich API for building fantastic UIs that you could only dream of doing in Winforms!

    I think that WPF is simple great ! I love WPF !!!!!!

  2. If you’ll let me say that RAD is a subjective term, then I’ll say that one reason we chose WPF is that it _is_ the epitome of RAD. Pretending that the VS WPF designer does not exist (which is normally the case anyways), a Winforms designer can DnD their initial layout faster, but just typing in some XAML, I can have a fully functional UI done first. In no way am I a “csc-and-notepad-is-where-the-real-hip-hop-is” elitist, but I feel intellisense plus XAML just tears ish up.

    We chose WPF for the whole package, but if I had to name one reason, it’s because we can deliver better ways for the customer to use our product. WPF lets you design your software around a human, instead of designing software around the limitations of a given UI technology.

    I can understand that WPF doesn’t fit all classes of applications yet, but I want to say to most critics of the framework, “If you don’t like it, you probably don’t understand it.” – Yeah, I’m a WPF snob.

    πŸ™‚

    -Jer

  3. edddy says:

    I moved to WPF because it makes more sense to me to have layouts like grids than using drag and drop and spend too much time aligning and making the form pretty.

    I do it for advanced data visualizations aswell.

  4. xanth21687 says:

    guess I am lost, got no idea on this stuff…still I have to review on web programming…

  5. sacha says:

    Excellent post Josh. I just think WPF kicks ass, and its just a fun API to work with. NUFF said WPF rules OK

  6. Josh Smith says:

    Thanks for the feedback, everybody. I agree with all of your points.

    Josh

  7. Nish says:

    In my case, I was mostly attracted by the fact that everything was new, so had to learn things from scratch. Then when I saw how quickly and elegantly you can stylize the UI, I started liking it better. Obviously there are some performance issues that are major bottlenecks, but that should change in the next version or at least the one after that.

    I don’t miss the RAD designer for complex UI, but when I want to quickly put together a simple dialog that has a few text controls and buttons and maybe a combo, I miss the designer.

    Oh, and it was good to finally meet you, though we couldn’t talk much.

  8. Josh Smith says:

    I know what you mean. The weak designer is not too relevant when building complex UIs. At least, not for some people. I have met others who live and die by the designer, so their story might be different.

    It was good to meet you too, Nish. If only the Summit was not so busy, we could have had time to chat more! πŸ™‚

  9. Rudi Grobler says:

    Hi Josh,

    Excellent post… The list of what I like about WPF is just tooooo long… But the higlight are the layout, content model and data binding… its just sooo much better!

    Rudi

  10. Josh Smith says:

    Rudi, I know what you mean. πŸ˜‰

  11. Karl Shifflett says:

    Josh,

    Super nice post Josh!

    Give me MAD over RAD anyday! Never used the RAD WinForm or ASP.NET tools anyway. Blend fills in the missing gaps for now.

    I’m thinking about writing a databinding add-in for VS 2008 to assist developers with the databinding to objects and other controls. This will help with forms and data template development.

    Cheers,

    Karl

  12. I think it’s important to understand on what front RAD stands. Up until now, RAD seems to be more based on development practice standards while WPF provides an incredible leap in interaction design. Perhaps Rapid Application Design and Development would be better suited since the factors that make up WPF have dramatically increased that – at least for me they have.

  13. Josh Smith says:

    Karl,

    Thanks a lot! I can’t wait to see your add-in…

    Thomas,

    That’s a very good point and important distinction. The loss of RADness is definitely (over)compensated by the much greater potential for superb user experience in WPF. If you factor in Blend, that line between RAD and UX becomes even more blurred.

    Josh

  14. judahgabriel says:

    I like the fact you can customize the look and feel of controls. With WinForms, every damn thing you do is a hack. Here’s a Win32 hack to get the RichTextBox to display links correctly. Here’s a hack to make the listbox behave the way you want it. I’ve had quite enough of that crap. πŸ™‚

    I like the way WPF apps feel. If I resize them, I don’t see flicker. They feel better than WinForms apps.

    Now, unfortuantely for me, the company I work for is still set on WinForms for the time being. We’ll release our product as a WinForms app initially. We plan on migrating to WPF in the future.

    In the meantime, we do our best to separate UI code from logic using the MVP pattern with a strict “no WinForms, no Sys.Drawing” in the presenter. While this is beneficial for unit testing, we also hope this makes for moving to a new UI toolkit less painful.

  15. senkwe says:

    For me, I always used to look at good looking Mac apps and wish there was an easy way to replicate some of those nice little UI touches and animations in Windows without pulling your hair out trying to tame Win32. And even recently, looking at an app like, say, Twhirl (which is an Adobe AIR) app, it just makes me feel alot better knowing that today I can very, very easily replicate any of those apps in a simple and elegant manner. The DataBinding and Animation engine are simply a joy to work with if you ask me. I can’t wait till we get that one indispensable WPF app that will open the floodgates to WPF. Right now it’s just a trickle, which is somewhat disheartening. But I have faith πŸ™‚

  16. Josh Smith says:

    Judah,

    I would love to know what goes well and what does not go well when porting your product to WPF. That would be a very interesting case study in MVP as well as WPF development.

    senkwe,

    I feel ya! The Win32 taming game is not exactly the stuff dreams are made of. πŸ™‚

    Josh

  17. mdizzy says:

    Prior company wanted to explore WPF to get past the limitations of Winforms for data display and editing. Rich UIs for a few of their marketing products was a big hit too.

    Currently not doing WPF so much (working at a custom software solutions provider and are limited by what the clients want) but the WPF bug has bitten me and I’m still keen on it.

  18. mdizzy says:

    BTW I’m totally flabbergasted by the idea that ASP.NET doesn’t support 2 way binding for simple forms!

  19. Josh Smith says:

    mdizzy,

    The data display and editing story of WPF rocks in comparison to WinForms and ASP.NET. I think you hit the nail on the head!

    Josh

  20. Sergey says:

    I moved to WPF (personally) a year ago, skipped WinForms because it wasn’t compelling enough comparing to Delphi. WPF is clearly superior and goes nicely with C#3.0, LINQ, WCF. Still my company is not making a switch yet, and the biggest obstacle is that our shrink-wrap product should work on a wide range of OS/hardware configurations. Only time will help here.

  21. Josh Smith says:

    Sergey,

    If I had included common reasons why people have not yet moved to WPF, the hardware and software requirements of the platform would have been in the list. But as you say, only time will help with that. Until the day that the average user’s machine is powerful enough, WPF has time to grow and mature some more. πŸ˜‰

    josh

  22. […] Why use WPF if it is not RAD yet? […]

  23. Brendan says:

    I’ve only started to learn WPF….again. I attempted it last year but just got too busy at work I had to put the book back on the shelf. I’m determined to get through it this time. Reasons why we haven’t used WPF yet? Sergey mentioned my main concerns. We have over 1000+ people using our s/w and alot of them would be running on Win2k. Our customers are people who aren’t really willing to spend money on h/w so as long as the existing s/w they have works (WinForms) they really aren’t interested in upgrading. This is the real stopping factor for us. We can’t spent months re-writing and re-testing s/w and then have the customer buy new h/w on top of it. As a small s/w company we would be out of business. I also find performance of WPF apps on WinXP less than satisfactory right now too. We just have to wait for all our customer machines on 2k to stop working πŸ™‚

    Reasons why I like WPF? I have to say I love the idea of the parent – child UIElement contents and how you can easily nest complex visuals to a panel or any other UI element so easily. To do stuff like that in WinForms is a nightmare or even required 3rd Party Controls. The binding is fantastic. The Routed commands and styling also offer great benefits. Any time i see someone restyle a standard controls template into something completely different it makes me smile just seeing how easy that was to do.

  24. Josh Smith says:

    Brendan,

    I think you are in a common situation. The hardware just isn’t there yet, but you see the potential of WPF for your software. With customers running Win2K you can’t even do WPF-in-WinForms interop, so I guess you’re really stuck on that one.

    This is one of those situations where it seems a shame that software development is mixed in with “the real world.” Wouldn’t it be great if we could just do whatever we, the developers, wanted? If the customers don’t like it, that’s their problem! πŸ˜€

    josh

  25. Brendan says:

    Josh,

    “Wouldn’t it be great if we could just do whatever we, the developers, wanted? If the customers don’t like it, that’s their problem!”

    Get out of my dreams, lol πŸ˜€

  26. Tim Dawson says:

    Hey Josh,

    I saw you at the MVP summit but didn’t get a chance to talk to you.

    I don’t really agree that WPF isn’t RAD yet. The designer isn’t as good as the 1.0 winforms designer was but it is fairly good. I run a control vendor company and our control offerings for WPF have awesome RAD designer support thanks to the APIs that Cider provides. In SP1 we’ll see some basic improvements in the designer that should answer the problems that people most frequently run into in the RAD space too.

    Tim Dawson
    Divelements

  27. Josh Smith says:

    Hi Tim,

    Thanks for the feedback, but I must disagree with your point. Just because Cider has the potential for RAD doesn’t mean that it, Cider, currently makes it possible.

    Josh

    P.S. I typically charge people for *advertising* on my blog. πŸ˜›

  28. Tim Dawson says:

    Josh,

    I can’t find any contact information for you here. We are willing to talk with you about advertising. πŸ™‚

  29. Josh Smith says:

    Hi Tim,

    I was only joking about advertising. Keep in mind that I work for Infragistics now, so there would definitely be a conflict of interest if I were to host your ad on my blog.

    Josh

  30. Eric Lacroix says:

    Hi Josh,

    Could you send me out an e-mail I’m working on a big project and I would like to get some feed back from you from moving from Visual inheritance to component agregation.

  31. […] Smith explained this point eloquently in his article “Why use WPF if it is not RAD yet” by stating: For those of us who approach WPF with a strong background in Windows Forms, […]

  32. Gary Hanson says:

    I got into WPF because of Silverlight. I always liked the WPF concept, but I work by myself now, and from long experience I know I’m not much of a designer. But I was an early Mac developer (refused to touch DOS), and then spent 14 years in Silicon Valley working for companies with great UI and UX (Apple, Adobe and Intuit). I really don’t use Cider that much. Blend is an awesome tool (still using free trials). Between that and the great support on the web from you, and, among others, several people who have already replied to this post, it is possible to produce much better UI than I ever thought that I could.

    I have already started doing a new desktop project in WPF. And definitely Silverlight on the web. I also wanted to rewrite my existing apps in WPF. But most of them use SQL Server CE and SQL Server Reporting Services (there are times that you just need to dump a lot of data). Unfortunately the new Client Distribution in SP1 doesn’t support WindowsClientIntegration. And the only way that I know of to do the reports in WPF is through WindowsFormsHost. I think the same is probably true for Crystal Reports. So, those of us with existing apps using reporting have the choice of using WPF or having a smaller download for customers (much less pain, and excellent selling point – which is why they made the client redist) and staying in Windows Forms.

    But definitely WPF and Silverlight for the future. Great stuff!

    -Gary

  33. Josh Smith says:

    Great feedback! Thanks Gary.

    Josh

  34. Mathew Tonsager says:

    Hey Josh,

    I have been working with WPF, Blend 2 and VS2008 for the last month and found it to be fairly easy to learn. I really like your articles including the ones in CodeProject. They have helped immensely. Once you get comfortable with these technologies you can develop some really amazing apps easily.

    I have become an evangelist of sorts trying to get my company to start changing over to WPF. We mainly use windows apps and some asp.net as well, and everything runs on Microsoft OS.

    However, there are some drawbacks using WPF with Blend 2 being a separate designer and not supporting VSS like VS2008 does. There is no DataGrid control, but 2 companies that I know of create a “Free” version of this grid, one of which you work for. Another is the animation and 3D graphics are awesome, but they are a huge performance drain on the hardware.

    Do you notice any other big performance issues or other show stoppers like this since you have been working with WPF?

    Thanks Josh for all of your hard work!!

    Matt