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:
- Databinding in WPF is superior to what Windows Forms offers.
- UI and C# business logic can be cleanly separated in WPF
- Storyboard
- Data/control templates – a much cleaner way than anything Windows Forms can offer.
- Styles – cool and simple. Its so easy to style all your buttons in an application to have the same look and feel.
- Even if the VS designer breaks, its easy to code XAML.
- 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.
- 3D support.
- 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.
- 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.

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
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.
[...] Matt Davey posts 10 advantages to using WPF and links to Josh Smiths’ post who answers the question “WPF vs. Windows Forms”. [...]
Development in a Blink » Blog Archive » Why use WPF? said this on September 5, 2007 at 11:06 pm |
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
BTW – in point (7) I think it should mention “UI virtualization” not “visualization.”
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.
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
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.
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.
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
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.
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.
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
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.
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
[...] 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 […] [...]
Top Posts « WordPress.com said this on September 7, 2007 at 12:42 am |
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.
Three words. Horrible Font Rendering! WPF font rendering is so stinkin blury (at least on XP SP2) that there is no way I can develop apps in it – it just strains the eyes too much. And, as far as I can tell, there is no way to turn off the horrible anti-aliasing, and WPF ignores windows settings. Showstopper for me, otherwise I might like it.
WPF = Geek Crack.
Winfoms = Old Dog.
Interestingly,
Vista = Geek Crack.
XP = Old Dog.
If the XP to Vista conversion rate is any indicator of WPF adoption, I’d say 2011 is an optimistic time frame for WPF apps to go live beyond a small number of early adopters that service clients with the specs to run WFP apps.
The good in my opinion is that windows programming needs a facelift to be competitive with say things like Adobe Air. WPF is a good first stab, and as it matures it will be a killer tool to use, but it needs a little time on the vine (re: “you can just write XAML if VS breaks”) to work out the kinks.
.NET was a killer for earlier Microsoft programming frameworks such as VB6 and MFC. It was a huge jump but still there are plenty people who are using pre .NET technologies. I started using .NET with 1.1 and now i am on 3.5. WinForms has been a great platform to work with throughout. The bad thing is you can never be an expert because as soon as you grasp some technology, its already legacy. I use to laugh at people who said that when i was starting .NET. Now i can realize that myself as i have hold on .NET and within 6 7 years of their conception, WinForms are already legacy.
New technology, methodology, platforms are always exciting and mostly good but depends on applications and real world parameters. I dont think i would leave XP for Vista in next 5 6 years. So i wont leave winforms either. It depends on a developer how to get work done as people have developed 3D games in C language.
[...] is a lot more to WPF than meets the eye, so to speak. WPF vs Windows Forms Tales from a Trading Desk __________________ There are 10 types of people in this world…. those who know binary, and [...]
IS WPF another Windows Form? - Visual Basic .NET Forums said this on October 28, 2008 at 12:05 pm |
WPF may be cool for “for fun” developers. I would not mind trying it out. But I life in “real life”. In a company with a limited number of programmers and a lot of work and deadlines for projects and many complex, big applications you can’t just throw in a new technology and expect everybody to learn it and apply it, let alone change all the apps to wpf. And why should they, if good old winforms suit the purpose? If you’ve got a lot of time left (in having time left is a rather scary thought in your job) then you can spend time on wpf. In most applications that do not work with graphic development the end user won’t see the dif between winforms and wpf and therefore won’t mind which one is used. As long as that’s the way it is wpf is a toy for hobby programmers who are eager to test new technologies.
If they can solve the bufferedgraphicscontext exception bug, titlebar flicker on form construction bug, and the transparent background issues, it’s worth it to change over. Note: These are not features
I think that winforms is a monster that should be either put down or donated to a mad scientist for research/pleasure purposes.
It’s clear when you look at the lower level classes of .NET that winforms GUI was just a low level C++ or VB(eww) implementation that was hacked into a hybrid managed/unmanaged code format.
I would like a GUI environment that doesn’t make me want to crawl up in a fetal position and suck my thumb. I thought the benefit of having managed code was that now all exceptions can be caught and traced/diagnosed easily.
I swear, I go back to doing webdev coding sometimes just so I can remember what it’s like to work on a GUI with some sense of security. My job is to write apps, not track bugs for MS that they’re not even willing to fix.
I’m looking forward to picking up WPF. I expect it to be a very easy transition from a webdev backgroung (where I started), and the XML style of source code opens up tons of opportunities for mobility and interoperability with/through the cloud.
I know the guys who write assembler for fun and masturbate to Intel® 64 and IA-32 Architectures Software Developer’s Manuals will all be up in arms, but WPF could be (fingers-crossed) a step in the right direction.
I absolutely loved how easy it is to work in C# .NET when I started coding desktop apps, until, I had to start using winforms for serious application development. Nothing like taking a well oiled machine and filling the tank with sand ::sigh::. Note: I didn’t come from a C++ MFC background so I have no appreciation for walking to school 2 miles uphill through the snow both ways.
First, forgive me for my lausy english.
You all are crazy if you realy think that WinForms will be dead soon. I would love to know that WPF will kill Winforms but, in my opinion, the WPF will die long time before the end of WinForms.
I’me investigating the possibility to use WPF in my entreprise nextgen applications. So far, the conclusion is that WPF was great if we need software that looks like pink japanese watches for teenage girls when we need is rock solid,fast and reliable Apps.
Regarding to the separation between UI and Code… a lot of umbilical chords remains there that should’n be. In my company’s current software version (MFC) that separation is real and the dependency is reduced to minimum. We are studing the need to migrate all that mechanism to new version since no technology ón the marked is good enought, not eaven WPF.