Those of you who follow my blog regularly know that I'm currently engaged in some of the Silverlight boot camps by giving speeches and keynotes. The really cool aspect about it is not so much that giving speeches can be motivating if your audience is very responsive and enthusiastic (as the majority of the Silverlight community is), but more over the community and networking effects which accompany these activities. From time to time I happen to meet long-time .NET developers who ask why Windows Presentation Foundation (WPF) should matter to them and why not just stick with Windows Forms.
As I'm for once engaged in my own company which more or less builds and sells traditional enterprise applications (most of them implemented as Windows Forms solutions) and in addition own a majority of another company which does the opposite - focusing on the latest visual technologies to create cutting-edge user interfaces - I regularly deal with discussions grouped around "the user interface" in my professional life, too.
As it turns out, there is no simple, single or best answer to the question. However, there are numerous compelling reasons why every serious .NET developer and every company creating software for Windows operating systems should look into WPF.
Clearly: Windows Forms is not dead. Microsoft continues to invest into Windows Forms, but there will be no major enhancements to it after version 2.0 was released in 2005. Microsoft is clearly investing in WPF - not Windows Forms - as the future presentation platform. Obviously, if you’re targeting only Windows XP and Windows Vista, WPF is the way to go. But Windows Forms is still the only way to write managed user interfaces that will run on Win 2K and below.
The most common and frustrating misperception about WPF which I’ve encountered is, that it is just for applications which simply require “eye candy”. Sure, WPF has a lot of support for flashy visuals and animations. But that’s not all it’s good for.
Whenever the discussion touches upon the rich media and composite controls aspects of WPF, I do hear product managers and engineering leads yell: "Well, this is not what we need in the enterprise space. There are so many basic problems still to be addressed in enterprise software, that a compelling presentation of the user interface can merely be neglected". I also often hear that "Users don't want this. They are not there, yet."
I sincerely disagree with this traditional opinion and consider it primarily a myopic excuse for these people's inability to persuasively argue the investments required to addressing a move towards WPF for the teams they lead.
Besides enterprise software (and the accompanying legacy systems) we can see a massive and obvious move to more cinematographic richer user experiences nearly everywhere else. Whether one takes the latest operating systems (Mac OS or Windows Vista) or software that runs on devices such as TiVo, Xbox and on the Web thanks to Adobe Flash. The next generation of interactive IP television sets will add significantly to this movement.
It's a simple fact: Today's TV sets, cell phones and other devices increase the users' expectations for the experience of using software and companies better spend a great deal of time and money on user interfaces that differentiate themselves from their competition.
And while you and me might still be used to use a black and white console from time to time - and might argue that that has in fact been the best user interface ever - there's a whole generation of teenagers who will be the enterprise users of tomorrow and will be used to way more appealing user interfaces than most companies offer to them today. And while this still might be a reason to argue "well, that'll be customers tomorrow, so it's still early enough to look into this sometime in the future", successful companies leave competition behind because they lead and do not just follow.
There are a couple of facts about WPF when compared to Windows Forms:
- Data / Control templates provide a much cleaner way to declare how content gets rendered than anything available in Windows Forms.
- Data Binding in WPF is superior to what Windows Forms offers.
- C# and UI business logic and code can be cleanly separated in WPF.
- Styles provide a cool and simple why to easily style all buttons in an application to have the same look and feel.
- UI Virtualization comes for free and significantly enhances performance (dealing e.g. with tables with 100k+ rows).
- 3D support.
- UI development feels quicker in WPF (maybe its just because a WPF application looks way more appealing at the end of an iteration, or maybe its because development really is quicker).
- Adding a User Experience engineer to a development team, with no C# knowledge is easy. That way somebody with a strong designer background can work magic in Expression Blend and give the enterprise application a makeover that is guaranteed to win over the business users.
Besides these facts - and the list could be continued - the primary argument for starting to invest into WPF is understanding the importance and central role of the user interface for the process of user acceptance. There is a steep learning curve involved and some of WPF's concepts are so superior to what Windows Forms offers, that traditional developers might want to resist starting "from scratch".
However, on the long run companies who are not willing to innovate on the presentation layer will lose their market share to competition that does.