6

WPF is positioned as a successor to WinForms, but given Microsoft's practice of abandoning toolkits (and what I perceive a s"bloat" in WPF), are there any recommended alternatives?

Tony the Pony
  • 40,327
  • 71
  • 187
  • 281

8 Answers8

14

I don't think you need to worry about WPF being abandoned. WinForm was around for a long time, and WPF is the replacement.

Bloat? I don't know. It seems like a huge upgrade from WinForms to me. If there's bloat it's always going to be there because underneath everything is the Win32 API. Until that gets rewritten from scratch I don't think anything will be perfect. And since every toolkit targeted at the Windows platform has to deal with that, I had rather go with WPF and ReSharper.

peterh
  • 11,875
  • 18
  • 85
  • 108
Chris Holmes
  • 11,444
  • 12
  • 50
  • 64
7

Another sign Microsoft is serious about WPF is that it's getting used to make Visual Studio 2010. XAML seems to get used by more than just WPF (Workflow Foundation, Communication Foundation).

I've been coding in WinForms for the past 5 years and I was a bit sceptic of WPF too at first. But after reading a few books and trying out my first application in WPF I'm starting to see the beauty of it!

I keep amazing myself at how little "glue" code is needed in a WPF application compared to how I would have done it in WinForms. Here's an example: I had to show a simple histogram. In WinForms I would have written a custom control and handled the rendering myself. In WPF, I did it all from xaml without one line of code! I just bound the data samples to a list box, replaced the listbox's layout template to an horizontal stack panel, and replaced the item template to rectangles which height is bound to the sample values!

  • 4
    I think that Windows 8 being focused on HTML5 may raise a flag here. WPF adoption has never been that big, and MS will certainly be providing support in VS for HTML5 since it expects applications for Windows 8 to be written in HTML5... – Loudenvier Jun 22 '11 at 04:19
  • @Loudenvier That's not strictly true. The HTML5 support you are referring to is using the new Windows Runtime, which is the Metro part of Windows 8. Visual Studio 11 is an application built on the desktop part of Windows 8, which has no access to WinRT. WPF support will continue through Windows 8 on the desktop side of the operating system. – Samuel Slade Feb 20 '12 at 14:54
  • @SamuelSlade you are right in everything you said. It is all true and correct. And it doesn't contradict what I said too. But I would never start a new project in WPF today. In fact, I've refused a job offer (paying more!) because it would be to manage a WPF project and I think the technology has no future, and I didn't want to spend a lot of time working on "deprecated" tech and then become somewhat obsolete on the "market". HTML 5 (I know: what really is HTML 5? No one knows :-) is the answer for me, or good old WinForms :-) – Loudenvier Mar 27 '12 at 19:46
  • It's funny though. I hate writing WPF apps for the desktop, but I love XAML. I hate how limited HTML (and even HTML5) and CSS is, and I like many others out there would love it if we could use XAML as an alternative to CSS/HTML. – jay_t55 Aug 18 '14 at 17:42
6

MS does not have a practice of abandoning toolkits (WinForms, MFC, ActiveX and Win32 are all still being actively developed) and the "bloat" is actually new capabilities you may not need right now but there's a good chance you'll need in the future.

If you don't want bloat and use only an API that will be impossible for MS to stop supporting you are more then welcome to work with the Win32 API directly.

Nir
  • 29,306
  • 10
  • 67
  • 103
4

I believe 4 out of 5 developers never ever look beyond the surface of a technology, they just want to drag & drop a few controls, write a few lines of code and get something up & running, maybe googling for some samples to help iron out a few kinks, and that's it. To such folks, bloat is not a word in their dictionary.

I, for one, prefer to look under the covers and really figure out how a technology actually works before jumping into writing code using the technology. Today, I spent an hour or so to investigate how the WPF built-in commands work, and with the help of reflector i managed to track down how a simple built-in Cut command is executed for a plain-vanilla textbox control, and guess what, by the time the text changed event is raised for a cut operation, there are around 30 calls on the call stack, isn't that code bloat?

WPF certainly has many powerful functionalities, but they do come at a cost. In some ways, i feel that WPF is to WinForms what MFC is to Win32 API; both WPF and MFC has the word "Foundation" at least :), but it would be interesting to watch if WPF will come to the same fate of MFC.

bondijct
  • 353
  • 1
  • 3
  • 9
3

Qt Quick (QML) is the way to go. It has extremely sharp design, and it is kept from being polluted by XML unreadability.

Dom
  • 61
  • 2
3

It depends on your favorite programming language, but Qt is a good Gui toolkit for C++. It has impressive features, is free and as platform independent as it gets for GUI toolkits.

sth
  • 222,467
  • 53
  • 283
  • 367
  • I don't think it is free for commercial use, however. – ine Mar 10 '09 at 22:24
  • @amdfan: Didn't this change with the moving to LGPL? – Nick Devereaux Mar 10 '09 at 23:07
  • 1
    It is. It's available under LGPL since v4.5, so you can use it in closed source and/or commercial applications. Only changes you make to QT itself need to be made available as source code. (see http://www.qtsoftware.com/products/licensing) – sth Mar 10 '09 at 23:07
1

Adobe AIR is the strong competitor. If you aim to create cross-platform applications with rich user interface, check out this one.

bohdan_trotsenko
  • 5,167
  • 3
  • 43
  • 70
0

First of all, I love WPF! I don't see any elegant/immediate way to achieve the same functionality and flexibility for designing interfaces in WinForms... That said, it is very sad to see that WPF is not anymore in favor inside Microsoft. Actually some people, including 'insiders' have stated that MS has shifted focus form WPF, and the Silverlight is now THE Windows Phone 7 application framework (not something to supplant Flash anymore):

http://www.theregister.co.uk/2010/09/09/microsoft_html_5/

Many people, including the current WPF Leader, denies this, but I see that this may actually have some truth behind. HTML5 is certainly going to become the "de facto" standard for rich (web)client interfaces. It overlaps so much with WPF, and does many other things too. It can "easily" be extended to work for non-web rich-client applications, and I believe MS will invest in that to have the lead in development tools for both web, mobile and windows targets.

I would not fear abandonment if I was already in the middle of a WPF project, but I wouldn't start one in WPF either as many have already said: it is not that simple to abandon something like WPF without giving a migration path and supporting it for many years.

So, current alternatives for WPF in the MS world? I don't think we have one already, maybe using its subset in Silverlight is the way to go for now. But, in the upcoming years HTML5 will probably be THE alternative to WPF.

Loudenvier
  • 8,362
  • 6
  • 45
  • 66
  • Well, -1 because of my "Wild speculation" and what is coming with Windows 8? (Winter is coming? :-) HTML5... WPF and Silverlight being abandoned in favor of that wild speculation... I always thought that -1 unfair... – Loudenvier Jun 22 '11 at 04:17
  • It's still speculation, albeit well-reasoned. I would undo the -1 now if I could but it's locked in. – sourcenouveau Jun 22 '11 at 13:26
  • 1
    Hey man! Don't mind it! Your -1 made me think a lot more on the subject myself. My opinion became more sedated on the matter, after all, yes, it is speculative. The day no one disagrees with your opinion, well, that would make me worrisome... :-) – Loudenvier Jun 22 '11 at 15:02