Smallfish

Tips, Tricks, Shticks & Anything That Can Help You Be better Developer

WPF vs. Windows Forms

This argument exists since the first version of WPF (Windows Presentation Framework), so what should one select, WPF or Windows Forms?

I will start with my conclusion / disclaimer:

Any new windows client should use WPF!

Now, for the explanation:
The biggest "flaw" of WPF is its learning curve, it is slightly hard to understand the "rhythmic" of it. Thus, many companies / developers prefer the comfort zone of windows forms as it seems more easy and "fast" to develop.
The fact is that after you pass over the first barrier of WPF, it become much easier, simpler and faster to develop.
Aspects where WPF that led me to my conclusion:

  • Productivity:

The most valuable feature here is WPF data binding, it saves your time because you don't need to manually mess with the controls directly, and by applying good design such MVVM or alike you will go faster. So, you may say "windows forms supports data binding also", and yes, you right but it is like comparing Mercedes to Subaru (nothing bad with Subaru, but …).
I have put this first because in most applications (especially commercial) developers' time is the most valuable in terms of money.
WPF supports many other automations that leads you to the (my?) first rule if productivity: Write Less Code, because writing less code takes less time, introduces less bugs (there is exponential or at least linear correlation between the amount of code you write and the number of bugs you have). Writing less code requires less source code which ease visual studio / source control to work much faster, and thus takes less valuable time of the developer.

  • Usability:

In WPF it is very simple to create more usable application which, for my opinion, should be the most critical measurement for the customer. One if the features that enables this is the Commanding architecture that let's you bind a command to various buttons / input gestures like keyboard shortcuts or even multi-touch gestures in the near future.

  • Performances:

The most valuable feature in this area is the use of Hardware Acceleration which is not only speed up your graphic it is also frees the main CPU for other important tasks. For more information look at WPF- Pick Your API Abstraction by Pablo Fernicola.

  • Technology:

In most fields newer technology is better, with less defects  as it evolves from experience in the problem domain, tooling and processes. I will bet that Microsoft® used better development and product manage process in WPF than in windows forms.

  • Support:

Traditionally Microsoft® supports application for about ten or twelve years (my informal rough estimation) which means that WPF will be supported long after windows forms and it will continue to be developed further in contradiction to windows forms (that already stopped&).

  • Eye Candy:

Beautiful applications sell better, it's a fact. In WPF you almost have to create nicer application because it easier and because it let's you cooperate graphics designers in the process.

References:

In Defense of Eye Candy by Stephen P. Anderson

Enjoy WPF, Now!

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: