Advertisement

Is it worth learning WPF now?

Started by January 20, 2012 05:03 AM
9 comments, last by Luisbrujo 12 years, 9 months ago
Hi, I've been working on my own for the past 3 years programming in C# with winforms. Lately I have been looking into WPF and have been amazed of what it can do. I've been tented to switch from winforms to WPF but the thing is that Microsoft has embraced HTML5 and javascript to develop Metro applications for their upcoming Windows 8 and I'm afraid they will let technologies like WPF to become legacy products and not receive any significant updates, just like they did with MFC and winforms. So with that said, should I forget about WPF or is still worth learning it?
Thanks in advance.
No idea, but I switched from winforms to WPF a few years ago. I really like WPF, but it has a really steep learning curve and some things that will often make you go "why do I have to do all of this work to do this simple thing?", however there are times when messing with bindings that you'll go "I did all of that without any code?" and you'll see the merits of WPF.

Honestly I probably don't use it right most of the time, but I think its worth learning. Not sure what it's outlook is like, but something similar to WPF in regards to its XAML layout is definitely the way to go in the future.
Advertisement
Ive also found learning WPF a valuable experience. Its a really well designed framework, and there is a lot to be learned from it. Creating a databinding in any other framework tends to make my physically sick, having gotten used to WPF.

HTML5 is not going to replace real GUI programming. I mean, if your core busines is making standard web thingies, then maybe thats a valid consideration, but if you are coming at this from a winforms background, WPF is a step forward, and HTML5 is, well, HTML. With videos.

Winforms does not recieve any significant updates because its pretty much a done product. And its not like you are signing up with some kind of beta product with WPF either; even if it never got a single update, its a solid product.
But it's hard to consider WPF or .NET to be dead when a developer preview of .NET 4.5 has just been released

Having said that I remember when WPF just came out a while back and was supposed to be the future but guess what.
The tools i.e. Blend, Visual Studio 2010 (GUI I believe is written using WPF) for using it were quite buggy at the time so everyone stuck to winforms and even then there is some stuff that only MFC or raw Win32 API could do and they were always adding new stuff to winforms to make up for it.
From the above post and the buggy/crash happy Metro app from Petzold website it sounds like things haven't changed much.
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe

But it's hard to consider WPF or .NET to be dead when a developer preview of .NET 4.5 has just been released

Having said that I remember when WPF just came out a while back and was supposed to be the future but guess what.
The tools i.e. Blend, Visual Studio 2010 (GUI I believe is written using WPF) for using it were quite buggy at the time so everyone stuck to winforms and even then there is some stuff that only MFC or raw Win32 API could do and they were always adding new stuff to winforms to make up for it.
For the above post and the buggy crash Metro app from Petzold website it sounds like things haven't changed much.


I have never heard anyone say WPF or .NET is dead, and if I did I would tell them they are an idiot. Silverlight on the other hand... not a real compelling reason to use it and MS knows this. Even Adobe I think sees the eventual end of the rich media plugin for websites as they are abandoning flash on mobile devices and targeting html5 tools instead.
WinForms is awful. It's design is bloated from the start, trying to mimick Java and its GUI libraries design, which are flawed.. C# made some critical design flaws from the beginning around late 90's or early 2k, language wise. Both Java and C# tried to learn from C++'s mistakes, which were just bad coding practices, and which C++ grew out of. IMO most flawed aspect about C++ is the backward compatibility to C.

Ok maybe I went off-tangent. WPF is better, but it is also focused on unnecessary very deep class inheritances to try to reuse implementations by inheritance.

System.Windows.Forms.UserControl:
107 properties
230 public or protected methods.
70 public events

Im a bit drunk atm and i just skimmed the msdn through. But we're talking about god objects here. WPF might have less.

Both WinForms and WPF fail at single responsibility principle for objects. IMO they fail at OOP.

WPF is better just becouse databinding and themes. I did localizations for traditional and manadrine chinese for 3dmark11, aswell other languages.
Advertisement
My off-topic rant was that C# and Java requires manual control of resources, its like back to the C or assembly.. It's not so easy as using RAII like in c++.
A = cost of learning + missed opportunity cost
B = revenue earned due to the skill

C = B - A

If (C > 0)
print "It's worth learning"
else
print "It's not worth learning"



In general, UI frameworks are the definition of jobs of "Programmer: the keyboard operator". They don't solve any business problem, they don't solve any valuable task - programming for such frameworks is the very definition of assembly line programming. The more magic, the less it's worth.

So don't get too hung up on them. MFC is still going strong and will continue to do so. Because what matters is the function the application performs. In most cases, the knowledge contained in these applications is so large there simply is no way to migrate away, despite the lack of MFC programmers.


If you want an enterprise job, it won't matter anyway. "Knowing WPF" means: "obtaned certification in WPF, has a phone number for reference confirming the job performed over past 2.5 years was WPF 1.0 development using Visual Studio 2008 SP1 on Windows Vista SP1 using Button 2.1.3.15 component." In short - it doesn't matter, it comes down to how you can properly pad your resume.

For everything else - can you do the job? Really fast? With little nonsense? Great.
I went for WPF over WinForms and am happy with that choice. I don't use xaml. xaml makes a right mess of your code structure and introduces partial classess which are horrendous. I also avoid the Application class.

As for windows 8, the only reason to dance to microsofts tune is if you want to get on their App store. From what I can make out WinRt seems to be a big step down from WPF. As for writing apps in HTML5 and JS. Its great to see they've still got a sense of humour. Anyway Microsoft when you've got a sensible candidate for WPF replacement get back to me. Lets take C# 5.0, frameworlk 4.5# and visula studio 11, but I think I'll pass on Windows 8. That also means passing on bulldozer as windows 7 can't tell the differece between a separate core and a seperate Module, but no loss there eithor.



Once Windows 8 has successfully flopped, we might be able to start looking forward to a new 64 bit XBox. Even if one doesn't intend to use Xna, it might be propt Microsoft to produce something usefullly new in terms of API

I went for WPF over WinForms and am happy with that choice. I don't use xaml. xaml makes a right mess of your code structure and introduces partial classess which are horrendous. I also avoid the Application class.

As for windows 8, the only reason to dance to microsofts tune is if you want to get on their App store. From what I can make out WinRt seems to be a big step down from WPF. As for writing apps in HTML5 and JS. Its great to see they've still got a sense of humour. Anyway Microsoft when you've got a sensible candidate for WPF replacement get back to me. Lets take C# 5.0, frameworlk 4.5# and visula studio 11, but I think I'll pass on Windows 8. That also means passing on bulldozer as windows 7 can't tell the differece between a separate core and a seperate Module, but no loss there eithor.

Once Windows 8 has successfully flopped, we might be able to start looking forward to a new 64 bit XBox. Even if one doesn't intend to use Xna, it might be propt Microsoft to produce something usefullly new in terms of API

This topic is closed to new replies.

Advertisement