Tuesday, September 11, 2007

To WPF or WinForm, that is someone's question

I asked for topics, and someone gave me a doozy:

As an expert on Windows Forms and WPF it would be interesting to have a post of what you think will happen in the client development space. Is everyone in 5 years doing client development going to be using WPF with Windows Forms pure legacy? Or do you think it will happen much faster than that?

I don’t usually chat about this kind of stuff, but I’ll give my best shot on the conditions that it’s 1) just my opinion 2) I’ve been WPF-free since January

Do I think you should rush out and try WPF?

Yes, because knowledge is power. If you’re a windows forms developer and you’re trying to make a choice of technology on your next project, you should take the time to have a quick play with WPF.

I’ve known several folks who take the stick-in-the-mud prospective on it: I don’t need 3D in my app, and if I wanted a gel button I’d use GDI+.

But what about text – have you ever tried to have gobs of text in your windows forms application without resorting to the web browser (cause RTF is an abomination)?

And next generation controls – have you ever tried to show more complex things in a treeview, but you’re pretty much stuck with an icon and some text?

Knowing what WPF has to offer (and frankly some of the limitations of the controls) lets you make a better decision. [Eric Sink, 47 Hats]

[Note my knowledge of WPF is 3.0 - I haven’t kept up with the changes in 3.5 or beyond. I’m sure WPF will be catching up it’s feature set, just like Windows Forms 1.0 and 1.1 had to. ]

Do I think Windows Forms will become legacy?

I think a more interesting question is this: what’s being developed in the shell?

So long as there is some other control out there with a different set of features, someone will want to platform invoke it. And minus toolstrips, and the datagrid* and a couple of the bizarre attempts at rewriting button and label, that’s pretty much what Windows Forms is.

The underlying competition is really user32, gdi, gdi+ and comctl versus WPF. It’s a pretty hard race to keep wrapping other APIs or providing the same features in managed code, so I bet some p/invoke is here to stay.

[Note: I do not know anything about future plans, this is merely my best guess.]

An even more interesting question is not “what will we use?” but “what will we build?”

It’s an interesting trend that a lot of popular applications today connect people and places. Think Google Earth, Facebook, Second Life. All of these applications are popular because to a certain extent they connect people with other people or places they know.

They all have “organic platforms” for letting people grow and extend the original design. I think we’ll see lots more of that in the future. …and Facebook proves we don’t need 3D and gel to do it.

4 comments:

Anonymous said...

wasn't there something like WPF is using hardware acceleration and gdi/gdi+ is using an emulation in vista ?

JFo said...

It looks like you might be onto something.

It goes the other way too. If there's a problem with the video drivers, WPF falls back to software rendering, which can slow down the app. http://msdn2.microsoft.com/en-us/library/ms742196.aspx

You can test out what your app would be like by setting a registry key:
http://msdn2.microsoft.com/en-us/library/aa970912.aspx

Regarding Vista/GDI*, I dug around and stumbled across this note regarding software rendering: due to the nature of desktop composition (internal management of moving bitmaps and transparency and anti-aliasing of GDI+ being handled at the DWM core), operations like window moves and resizes can be faster or more responsive because underlying content need not be re-rendered

http://en.wikipedia.org/wiki/Graphics_Device_Interface

Eriawan Kusumawardhono said...

Hi jfo,

For me it seems Microsoft is heading to WPF direction in the future. This topic and many other things which is essentially the same has been discussed many times.

Some guys from Microsoft have already discussed this on their blog posts (I'm sure you've known some of the names from Microsoft side :)).

some examples of these are:

Mike Harsh on Windows Forms future:
http://blogs.msdn.com/mharsh/archive/2004/09/20/231888.aspx

Then from outside Microsoft, Dan Appleman discussed it:

http://www.danappleman.com/index.php?p=16

And many more from the links above.

IMHO, Windows Forms will continue to serve us within 3-5 years, or maybe more. But WPF will be further developed, and Windows Forms has reached its limits.

What do you think?


Deep down

JFo said...

There is a lot of investment in WPF. However, if the shell uses a different technology to display text, draw dotted rects etc, drawing dialogs that look like the operating system may always feel like a clone.