#52WeeksOfCode Week 10 – Windows Presentation Foundation

Week: 10

Language: Windows Presentation Foundation

IDE(s): Microsoft Visual Express

Background:

“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”

C.A.R. Hoare (British computer scientist, winner of the 1980 Turing Award)

Sometimes it seems to me like Microsoft exists in some parallel universe which only occasionally intersects with our own. I come by this opinion honestly. I’ve watched for decades as Microsoft rejects perfectly good technology (such as DNS) time after time and invents their own, incompatible version (like WINS).

This is not to say that the software in the Microsoft universe (Microverse?) is inferior but it’s as if they refuse to believe other software developers exist. The Windows Presentation Foundation is a good example of this. It uses MVVM, (Model-View-ViewModel), a Microsoft-developed descendant of the venerable MVC (Model-View-Controller) design model. It also uses their own version of XML (Extensible Markup Language) known as XAML (Extensible Application Markup Language). See? Like our universe, but different in many subtle ways!

Discussion:

WPF, as the name implies, is a User Interface (UI) framework. As such, I’ll readily admit that it makes creating a graphical interface extremely easy with simple drag-and-drop of a rich library of UI controls. In many ways, it reminds me of Apple’s Interface Builder, which offers similar functionality but is a separate application from their IDE, XCode. WPF, by contrast, is fully integrated with both MS Visual Studio and MS Visual Express.

Once I got Visual Express installed and running, I used one of the many good tutorials available to quickly work up some code. Building the UI was as simple as advertised and, since I didn’t need to do anything fancy, I added a single line of code and produced something that compiled and ran properly. (Basically, it was a button and textbox in a window. When you clicked on the button, “Hello World!” would appear in the textbox. The code is so trivial I’m not even going to bother embedding a link to it.)

That was really all the code I was looking for at this time, so I decided to get a sampling of opinions from developers about the technology. The ones that like WPF and XAML seem to do so because it’s a very clean separation of UI and programming logic. In addition, they like it because it’s so much better than what they used to use.

The ones who don’t like it, on the other hand, seem to do so because it’s not as good as what they used to use. They cite problems such as a poor design experience, bad animation performance, weak support for drag-and-drop (ironically enough) and that WPF makes the hard things trivial but the trivial things hard.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s