header image
 

WPF vs Windows Forms

I see Josh Smiths has posted his view on WPF vs Windows Forms.  Here’s my current view (although I reserve the right to change it at a later date :) )

Windows Forms is legacy.  Microsoft should label Windows Forms as legacy (as it has done with COM), only offer bug fixes and concentrate 100% on WPF.  WPF is the future.  I’ve had more fun building WPF UI than I’ve ever had with Windows Forms.  Ignoring the WPF fun element, I think the WPF applications I’ve build are far superior to anything I did in Windows Forms from the perspective of usability and visualization of data.  Here are a few advantages to using WPF:

  1. Databinding in WPF is superior to what Windows Forms offers.
  2. UI  and C# business logic can be cleanly separated in WPF
  3. Storyboard :)
  4. Data/control templates - a much cleaner way than anything Windows Forms can offer.
  5. Styles - cool and simple.  Its so easy to style all your buttons in an application to have the same look and feel.
  6. Even if the VS designer breaks, its easy to code XAML.
  7. UI virtualization - I’ve got grids with 100K rows, ticking off a moving market.  Performance would be dreadful if it wasn’t for UI visualization which come for free.
  8. 3D support.
  9. Nothing scientific but, UI development feels quicker in WPF - maybe its just because a WPF application looks cooler at the end of an iteration, or maybe its because development really is quicker.
  10. I can add a User Experience engineer to my team, and with no C# knowledge he can work magic in Expression Blend and give the front-office trading application a makeover that is guaranteed to win over the business users.

~ by mdavey on September 5, 2007.

17 Responses to “WPF vs Windows Forms”

  1. Interesting. I *want* to agree with you wholeheartedly, and initially was of the same opinion as you. However, in my opinion, the reality of the situation is that WinForms is far from dead…yet. Its murderer, so to speak, does not even have a non-beta set of tools to work with in Visual Studio. Big Daddy WinForms can’t be killed by an infant with no weapons! :)

    I think in about a year or two WinForms will be “legacy,” whether MSFT deems it so or not.

    Thanks,
    Josh Smith

  2. Hence why I said “concentrate 100% on WPF” and effectively drop Windows Forms :) Windows Forms has served the world well, but its essentially just a Win32 wrapper. Microsoft should have had VS enabled for WPF out of the gate - ok cider existed as an addon, but was never supported. Software engineers shouldn’t have had to wait till VS 2008 for true WPF support. I suspect every tier one investment bank has effectively held off from pushing WPF development apart from adhoc projects because VS 2008 hasn’t arrived.

  3. [...] Matt Davey posts 10 advantages to using WPF and links to Josh Smiths’ post who answers the question “WPF vs. Windows Forms”. [...]

  4. Ah, so you mean that WinForms is “dead” in the sense that WPF is destined to kill it. I see. That must make all the experienced WinForms folks feel warm and fuzzy! :)

    I have no great hopes for the WPF tools in VS2008. I’m really looking forward to the Rosario era, at which point Microsoft should have had plenty of time to work out all the kinks discovered in VS2008.

    Thanks,
    Josh Smith

  5. BTW - in point (7) I think it should mention “UI virtualization” not “visualization.”

  6. I agree with the advantages you have listed for WPF, but I don’t think winforms is dead by far…atleast not for the masses.

    I think the high-end dev’s will see that WPF can and will make their jobs easier, and give them more power to produce results. But I also think there are allot of dev’s who are scared of XAML, they either don’t understand it or are intimidated. That will keep winforms alive, just as VB6 is still around so will winforms for a long time.

    Personally I think the databinding features in WPF are worth the move alone, it cuts down on the amount of tedious code I have to write.

  7. TJ,

    I agree with everything you wrote. I’d like to add that “simple” things like routed events, attached properties, and triggers are also parts of WPF which make it a developer’s paradise compared to WinForms.

    Thanks,
    Josh Smith

  8. Honestly I think I want to have what you are all smoking. :) You’re all making the classic mistake of taking your own area of work and expertise and trying to extrapolate it to every other field of work and expertise.

    How is databinding superior? It works fine in winforms, different isn’t necessarily superior. Most of us that do serious databinding have already got our own libraries of helper code that pretty much takes all the tediousness out of the process anyway.

    UI and business logic separation is up to the developer, it’s nothing new, some of us have been doing it since the MFC / c++ days. Don’t piss on my leg and try to tell me it’s raining. :)

    Styles? WTF? How is this new, sure it’s easier to change them, perhaps 10 minutes as opposed to half an hour, so what? That’s not really a death knell for winforms.

    If VS breaks I fix it, you can’t work with broken tools, who wants to code in XAML? I could as easily say if VS breaks I can hand code assembly in wordpad.

    UI Virtualization, sure that’s cool, is it the death of winforms?

    We already have the tools to makeover winform apps with no muss or fuss, I can do that now with my 3rd party winform control suites, that’s not compelling.

    If you want to convince the non believers you really need to come up with something more compelling than “it’s cooler”. All I’m getting from WPF camp is a fuzzy Mac vs PC type argument.

    Sure it’s fun to work on the cutting edge but don’t get all misty eyed and forget that you’re about 5 years ahead of the curve out there. We’re still supporting customers using windows 2000 with our winforms apps.

  9. Databinding in WPF is not superior, its just better. IMHO winforms databinding compared to WPF cannot be called databinding. Yes you wrote your own library, but wait, do we have to wrote our own libraries?

    If VS breaks you fix it. In my case VS dont break because i use it for coding and for UI design I have Expression Blend, a powerfull tool destined to be UI designer.

    WinForms is death, sooner or later, its inevitable.

  10. I agree with Peter. It doesn’t sound like JCardinal is too familiar with WPF, which makes it easy to blow it off. Once you get into WPF and understand what it offers, it’s hard to imagine going back to WinForms. :)

    Josh Smith

  11. The major con for WPF, as I see it, is the stupid Windows XP or later requirement. This will set adoption back years.
    Windows 2000 is still widely used, and for good reason. It’s essentially the same OS as Windows XP, so there’s no reason for most users to upgrade.

  12. Hi Josh, actually I’m quite familiar with wpf, I’ve studied it, have *the* book for it, wrote a few apps etc etc. My issue is that I have released applications written with winforms, recently ported from mfc and running on many end users systems that are windows 2000.

    I agree that wpf is cool and I find the whole underlying windowing system to be a great idea, aside from that I don’t see a lot that could not be ported to winforms.

    It’s nice for Microsoft to have so many unpaid cheerleaders for their new technology, but I don’t think you guys realize how far ahead of the curve the great majority of us are working on. One guys comment here about “advanced developers” working on wpf as if the rest of us are idiots for not working with wpf shows this attitude is not grounded in reality.

    Think and post what you will, but to say that winforms is dead over and over sounds like you guys are just whistling in the dark to me.

    I agree that much of wpf is superior, I just don’t see any realistic way for it to take over from winforms for any kind of time frame you guys keep bandying about.

  13. JCardinal,

    Gimme a ‘W’!
    Gimme a ‘P’!
    Gimme a ‘F’!

    What does that spell?! “Alpha geeks who are bored with WinForms and found a new platform which excites them, so they blog about it and discuss with each other how much they look forward to it becoming mainstream!” :)

    Josh Smith

  14. Well to be honest it excited me as well when I first saw it, the xbap stuff is very dissapointing but wpf itself is undoubtedly cool, but I don’t see the death of winforms any time soon. I’m going to take a wild guess and say that if Microsoft is indeed moving to wpf and dropping new winform development a realistic time frame for seeing widespread wpf adoption would be somewhere around 2011 at the earliest.

  15. Yeah XBAP isn’t all that cool, imo. I actually just wrote a big harangue on that: http://joshsmithonwpf.wordpress.com/2007/09/05/wpf-vs-windows-forms/#comment-4853

    2011, eh? That seems a bit too far off to me, but only time will tell. Hopefully you’re way off on that estimate! :)

    Josh Smith

  16. [...] WPF vs Windows Forms I see Josh Smiths has posted his view on WPF vs Windows Forms. Here’s my current view (although I reserve the […] [...]

  17. The tntire .NET bandwagon is dead for me and we ported to WPF in beta and have it sitting around for kids to play.

    Do you really run that stuff on a live trading desk?

    Heck even WinForms?

    Cool, because we are fighting for money with our own native frameworks without any dumb, generic-for-all, leak to death data binding and WinForm CPU exhaustion.

    Classic Java following that will crash in Swing style spectacularity. Never stops this enthusiasm for MSFT marketing.

Leave a Reply