One of the common complaints regarding Microsoft is that the company has problems eating its own dog food. Even though it promoted Windows Presentation Foundation as the programming framework for building Windows and web applications, it so far failed to produce any significant WPF applications itself. None of Microsoft’s major applications use WPF (Expression Design and Blend aren’t major), which does not help in promoting it as the Next Big Thing. This may all change in the near future, as a small but extremely popular Microsoft application is about to make the switch to Windows Presentation Foundation: MSN Windows Live Messenger.
Since there often seems to be some misunderstanding as to what WPF exactly entails, I will let Wikipedia explain what WPF is.
The Windows Presentation Foundation (or WPF), formerly code-named Avalon, is a graphical subsystem in .NET Framework 3.0 (formerly called WinFX) and is directly related to XAML. Version 3.0 of WPF is pre-installed in Windows Vista, the latest version of the Microsoft Windows operating system. WPF is also available for installation on Windows XP SP2 and Windows Server 2003. It provides a consistent programming model for building applications and provides a clear separation between the UI and the business logic. A WPF application can be deployed on the desktop or hosted in a web browser. It also enables rich control, design, and development of the visual aspects of Windows programs. It aims to unify a host of application services: user interface, 2D and 3D drawing, fixed and adaptive documents, advanced typography, vector graphics, raster graphics, animation, data binding, audio and video.
While WPF was generally well-received, nobody, apart from Yahoo!, seems to be using it for any major applications. The consequence of this is that users do not encounter WPF-based applications, which in turn leads to lack of demand from users – you don’t miss what you don’t know. When Apple introduces a new graphical framework (Core Animation, for instance) or a new programming environment or whatever, Apple will use it in major applications, which in turn leads to other programmers adopting these elements. This isn’t happening with WPF, and it seems like Microsoft may finally be willing to start eating its own dog food.
As Messenger Stuff claims:
After being tipped off by an unaffiliated yet trustworthy source who – naturally – doesn’t want to be identified, Messenger Stuff can now reveal that the new interface will use the graphics effects available through WPF where supported (i.e. on Vista and with a decent graphics card).
While Messenger may be seen as a minor application, it does get deployed on many, many computers. In The Netherlands, for instance, Microsoft’s messenger service controls round and about 99.9% of the market, in such a way that “MSN’en” has become the verb for instant messaging. Windows Live Messenger might very well be a nice way for Microsoft to dip its toes into the WPF water.
Yahoo is doing the same with its Yahoo messenger.
Im glad with this, because WPF is a great platform.
Yes, but is MSN a great app?
Is it really? I haven’t ran across any WPF apps myself… do they run faster and consume less resources than those written in Windows Forms?
If it’s really that good, I’d like to see MS Office, Visual Studio, and all the major MS apps written in WPF, or even .NET for that matter.
WPF is .NET. Well, a part of .NET, at least.
I haven’t worked with WPF personally. But I think you need to evaluate it on more criteria then how many resources it consumes and how fast it is (whatever that means). Other factors that should also influence an assessment of the technology is what kind of things can you do with it that you can’t with older technologies? Does it allow fancy new transformations and widgits? Does it help to separate presentation from business logic? Is it easier to program? Design? API’s?
So while I would like to see it run at least as fast as winforms or older technologies and it likely will consume more resources if it’s doing more under the hood. If I were writing a windows application I would be more concerned about some of the points I raised in the previous paragraph than resources and some obscure metric of speed.
WPF is fully hardware accelerated witch means is faster than WinForms, the memory is pretty much the same or better since it uses video memory.
The benefits it has for the developer are great, I’ve used it and is a loooot easier than WinForms and a loooooooottttt more flexible,
Explain why people are calling it slow then?
I was under the impression that only under vista it is even somewhat hardware accelerated…
I’m slightly suspicious of you statement because you don’t say it is fast due to HW Accel, you say it is HW accel hence it is fast.
As a framework how is it faster in terms of user experience?
The only difference between WPF in Vista and XP is the font rendering, the rest is the same.
I don’t know why some people say it is slow, the cold start is slow, after that is as fast as any other application, and even the cold start has been refined in .Net 3.5 sp1.
Edited 2008-08-10 04:26 UTC
Same reason most people say vista sucks but Mojave is fantastic.
What people mean by that, is that Vista in its current state is fantastic… As a beta product!
The problem is, it’s really easy to muck up performance in WPF. There’s a TON of performance that can be done both in Code-Behind and in the markup language, XAML.
Having used WPF for about six-seven months I can tell you first hand, that with the great profiling tools provided by Microsoft, that anyone can improve performance.
Most importantly, you need to strike a balance. Yes, some animations will be costly, yes some effects will slow your application down to a crawl, but in the end..do you really need them? Too much of a good thing turns into a bad thing.
I’ve found that due to the ease of WPF (MVCish design pattern, separation of UI and logic) that it makes for GREAT Business Logic front ends.
Even if you don’t use any of the effects, the amount of flexibility you gain is invaluable.
WPF not only allows you to distinguish UI from Logic. It gives you an additional power.
You can set the source binding (Logic) you can set the binding control (UI) and you can describe a template for presenting that data.
So if I have a collection that I want to add to a ListView, I can not only set it to display that data — but I can format that data in any way I want.
WPF is a great platform, and it going more mainstream will only push Microsoft to tie any loose ends in it.
It is, it keeps the idiots out of the serious IM networks.
Amusingly enough, the biggest problem with MSN Mess is its first-party client software. It’s just fine when used with something like GAIM.
I know what you mean about the massive amounts of idiocy, though. My first real exposure to MSN messenger came while working in a middle school, I’ve never seen a piece of software used in so many facepalm-inducing ways. My favourites:
– morons with ridiculously-verbose status info, so that every message they sent contained the same 2 or 3 lines of text before the actual content of their message.
– for bonus points, these were usually the same geniuses who sent messages that were typically no more than a quarter of the length of their status text.
– and the eye-searing colours. Nothing quite like bold, italicized, and underlined 18-point electric pink text. In Comic Sans (or Arial Bold, the other favourite). Zee goggles, they did nothing.
Edited 2008-08-10 04:33 UTC
Anyone else read WTF? at first, instead of WPF? Just curious.
I thought something was weird when I read the title. That’s probably it.
Aoccdrnig to a rscheearch at an Elingsh uinervtisy, it deosn’t mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht frist and lsat ltteer is at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae we do not raed ervey lteter by it slef but the wrod as a wlohe. ceehiro.
Anidroccg to crad cniyrrag lcitsiugnis planoissefors at an uemannd, utisreviny in Bsitirh Cibmuloa, and crartnoy to the duoibus cmials of the ueticnd rcraeseh, a slpmie, macinahcel ioisrevnn of ianretnl cretcarahs araepps sneiciffut to csufnoe the eadyrevy oekoolnr.
Wow, both of you must have been using the “nyou english orfograffy” (versions +1 and +2) wich, vill becomm moar imbortannd inn the nexd Yeer`s off speling refforms a-kross the worlt. 🙂
Hah.. Funny thing is I read it as GPF instead of WPF.
I have really been looking forward to trying WPF, since Windows.Forms is really awful. But it turns out that WPF, while a bit better designed, is awfully slow for any really complex application. The demo applications all look very nice, but once you really try to do somethnig with it it slows to a crawl.
The micrsoft developer forums are full of complaints about WPF performance. For something as simple as an instant messager it might be OK, but for a real application (in my case a realtime scientific graphing application) it is much too slow even on a quad core machine.
And the available controls also leave a lot to be desired: they still do not have decent Model-View-Controller versions for essential controls like the tree view, and there is not even a property grid!
So in short: it is not hard to see why microsoft does not use it internally. It is just not ready for primetime.
Yes I do agree that the control library leaves things to be desired, but this is a new library and hopefully they will add more controls to the next release.
In the mean time you can use your windows forms controls in WPF and I have done it, it is quite easy. Look up WindowsFormsHost.
It seems that Yahoo Messenger has performance issues too. So even for something with a very simple UI like an instant messenger, WPF has some serious problems.
http://www.istartedsomething.com/20071206/yahoo-messenger-vista-lau…
The MSN Live Messenger is already sluggish, so I’m certainly not looking forward to this new version.
That’s an article from 2007 when Windows XP and Windows Vista both had problems with performance when using Layered Windows (Windows who draw their own chrome).
This has since been fixed, and Yahoo Messenger for Vista is pretty good now in terms of performance. Obviously it could use some work, but the person who’s working on it is a really smart guy and will get the problems fixed.
WinForms isn’t a bad platform. The problem is that WPF isn’t any better and there’s no migration path. Lack of migration means no code re-use so EPIC FAIL on Microsoft’s part IMO.
MVC is lovely and all that, but it is not the pinnacle of programming. Some would argue that it is actually a fairly short sighted pattern in a world of patterns. It certainly does not float my boat on a regular basis. I tend to find the Observer pattern far more useful.
Some times it is needed to break the migration path to come up with something cool and innovative.
I have tried WPF myself and yes it does take some getting used to and you will have to rewrite all GUI code but you can of course re-use any back-end code if your app is modular.
Actually there is a migration path of sorts. It is possible to embed an existing Windows form control in a WPF window and I believe the opposite is true as well. You can use both technologies in the same application so it is not necessary to rewrite your entire program at once just to take advantage of WPF.
— Replied to Wrong Comment —
Edited 2008-08-10 05:57 UTC
The MVC pattern is an extension of the Observer pattern. Views are observers of a model. It just makes another distinction about where manipulation of model objects takes place.
Could you explain in more detail how you use the observer pattern to solve the problem of separating content from presentation?
It depends on what you are doing. If you are dragging buttons and textboxes on to a form, there is little difference other then that WPF will look slightly nicer, and require more work. If you are doing anything that goes outside the box in the least, you really have to fight with WinForms while WPF handles it with ease.
Linked to this on another comment, but I’ll do it again here http://www.dnrtv.com/default.aspx?showNum=115
Imagine doing that in winforms. And just think about the competitive advantage something like that gives you in demos.
Edited 2008-08-10 16:37 UTC
Just because WPF is hardware accelerated does not mean that it is fast. Sad but true.
WPF works on a scene graph. If you have a scene graph with a few simple shapes that are animated in a time-based animation, it can be quite fast since that can be done by the GPU. Also if you use effects like drop shadows for your controls, most of them are almost free because they are using shaders to do this.
But if you do either a large number of geometric shapes (like a drawing or CAD program) or data-driven animation (like a telemetry-driven function plot) none of the graphics acceleration does you any good since setting up the scene graph is much more costly than rendering it. The CPU load will be at 100% while the GPU is maybe at 5%.
And what is the alternative to MVC for something like a tree view with a few million icons in it? In java swing it is a simple matter of defining a tree model and sticking it into a treeview. The treeview will take care of only creating the tree nodes that are currently visible.
In WPF you have to either create a million tree nodes or write the logic to avoid creating unnecessary tree nodes yourself. This really gets old after doing it a few times.
About the property grid: it is simply not acceptable to have no property grid at all. And putting a Windows.Forms property grid in a WindowsFormsHost is an ugly kludge and not an alternative.
Very true on most things. The lack of a property grid really irked me, I ended up taking a few hours off and writing my own.
I’m not sure what you mean about the problem with the Treenode creation, can you just not describe a binding relationship between the TreeNode and the source collection?
I’ve never dealt with sets of data this large (Speaking in terms of millions), so maybe there’s a pitfall I’m not sure of.
You should not have to. In the end you have lots of different, half-baked property grid implementations instead of a standard one.
Just like the lack of a set type in System.Collections.Generic caused everybody to write their own, incompatible set. (At least this is fixed now with 3.5)
See here http://www.beacosta.com/blog/?p=45 for an example for the strange hacks to do to show a well-performing view of the windows registry.
I agree that many ideas in WPF are quite nice (excellent separation between logic and presentation, declarative approach, etc.). But it is simply not suitable for large applications yet (and maybe will never be, since some design decisions are quite questionable).
dunno if you have seen this or not, but here is a demo of a big LoB app done in wpf http://www.dnrtv.com/default.aspx?showNum=115
There are still big problems with it, but it is pretty good for a 1.0 technology. I’m a web guy, and I have always had zero interest in client gui toolkits. WPF is the first that I have ever seen that I could see myself being happy working with professionally.
That is all very nice, but that is just a bunch of dialogs.
WPF is probably really good to write these kinds of applications because it lets people who are more familiar with markup write rich client applications.
But before you see something like word or visio in WPF, they will have to optimize it a lot more (or wait for moore’s law to save their sorry asses again). There is a reason office 2007 is not written in WPF.
By the way: I just tried expression blend on my dual core 2GHz notebook. I have the new .NET framework 3.5 sp1 installed which is supposed to improve WPF performance.
But it still sucks. I just created a new form and added about 100 copies of a control to it using copy/paste. Then I tried resizing one of the controls: it does not resize smoothly. The outline of the control is redrawn maybe two times per second. That is totally unacceptable for a machine that would have made it into the top 500 in the 90s and that can play far cry with decent speed.
Maybe I just have to use my 4 Core, 4 GHz, 64bit desktop machine with a 500GFlops graphics card to get a rectangle to redraw smoothly…
Do I have to conclude from this statement that WPF in general or at least its use in “bigger” applications is just something for today’s most high-end PCs? In other words: Will “Windows” users have to wait for tomorrow’s PCs in order to use WPS based applications at the same speed they experience their applications on their PCs of today? What is the advantage to the users, except of having the same functionality in a new look?
In regards of hardware accelerated operations it reminds me a bit of the hardware representation of OpenGL stuff in SGI graphical workstations 10 years ago. Interesting to see how good concepts get repeated over the time…
And this is my receipt for your receipt. 🙂
This is the change log for .NET 3.5 sp1. many preformance updates to WPF. its a rather large difference.
Latest Changes:
ASP.NET Dynamic Data, which provides a rich scaffolding framework that enables rapid data driven development without writing code, and a new addition to ASP.NET AJAX that provides support for managing browser history (back button support)
Core improvements to the CLR (common language runtime) that include better layout of .NET Framework native images, opting out of strong-name verification for fully trusted assemblies, improved application startup performance, better generated code that im
Performance improvements to WPF (Windows Presentation Foundation), including a faster startup time and improved performance for Bitmap effects
ClickOnce application publishers can decide to opt out of signing and hashing as appropriate for their scenarios, developers can programmatically install ClickOnce applications that display a customized branding, and ClickOnce error dialog boxes support l
The Entity Framework is an evolution of the existing suite of ADO.NET data access technologies
LINQ to SQL includes new support for the new date and file stream capabilities in SQL Server 2008
The ADO.NET Data Services Framework consists of a combination of patterns and libraries, which enable data to be exposed as a flexible REST (Representational State Transfer)-based data service that can be consumed by Web clients in a corporate network or
Windows Communication Foundation now makes the DataContract Serializer easier to use by providing improved interoperability support, enhancing the debugging experience in partial trust scenarios, and extending syndication protocol support for wider usage
The .NET Framework Data Provider for SQL Server (SqlClient) adds new support for file stream and sparse column capabilities in SQL Server 2008