Posted By: Glucose | Jun 18th @ 12:09 AM | 41,541 Views | 27 Comments
Scott's in Norway this week. The speakers in the speaker room are preoccupied with death and now they're asking about the death (or not) of WinForms. Rocky says he wants to see more practical talks on WinForms and advanced techniques but that most conferences aren't interested in those kinds of talks. Too much future tech too soon and too fast? Peter Provost jumps in as does Scott Bellware.
Rating:
2
0
TommyCarlier
TommyCarlier
I want my scalps!

I'm still a heavy user of WinForms, both at work and at home. I'm very familiar with it, both with WinForms and even lower-level Win32 and GDI/GDI+, and I still think it has a performance and productivity advantage for most regular applications. The tools I use (and develop) don't need rich interactive media and animations and buttons with graphics and multiple lines in them. I have enough experience in WinForms and the lower-level API's to customize my controls if I need something a bit fancier.

As a member of the team that produces our MIX and PDC events (and someone who participates on our Tier 1 events council at Microsoft), I'd love to hear feedback on this topic. We're listening!

vesuvius
vesuvius
Das Glasperlenspiel

This is a little like the C++ guys complaining that all the interviews are C#.

I have in depth knowledge of Winforms, ASP.NET and am now earning my crust in WPF. I think that there are still huge gains to be made using Winforms over WPF in more than a bunch of areas, and Microsoft marketing have gotten a little too much influence over "selling".

Microsoft have been muted in this regard, because they have not invested in the technology for years - although 3rd parties have - meaning that in product launches or conferences based around the innovation of the company, it is all too easy to forget. In some ways, they "threw the baby out with the bathwater" because they are like teenagers with music, always looking the next big thing!

 

Personally I was disappointed with TechEd this year (my first) *because* I expected there to be lots of talks about advanced WinForms and other related topics.  Visual Studio 2010 and .NET 4.0 are great, but the reality is our company is our department is just now getting the green-light to spend the time to transition to VS2008.  We develop a large WinForms app and our data shows that only ~50% of our customers even have .NET 3.0 installed; moving to WPF is the goal but WinForms is the fact right now.

WinForms has lots of catch-22's, and what we do in WinForms that we consider to be advanced is probably more along the lines of medicre hackery to get by--true advanced WinForms topics are beyond what we want to learn on our own because there can be so much pain in learning about the limitations and boundaries before getting the understanding of the capabilities.

I went to TechEd really hoping to get the nitty gritty details and pointers for VS2008/TFS2008, and really hoped to find some advanced sessions for topics applicable to .NET 2.0 such as databinding, memory management, intensive debugging (post-mortem type stuff with windbg, performance tuning, etc... instead it was largely a week of "here's what you could do if your customers used Vista (they don't), kept the latest version of .NET installed (a few do), use SharePoint (not in our business).

...just finished watching the rest of the video...

Productivitity is slippery.  To be able to make use of these productivity-enhancing technnolgies and features at the very least requires one to take a non-trivial amount of time to learn how to use them; time which is very close to 100% unproductive.  Once how to use them is known then one has take the time to ask "can I use them?", if the answer is no then it's 100% time lost--if the answer is yes then there is almost always a fair amount of unproductive time spent trying to find out how to leverage these productivity-enhancers in our unproductive environment--and usually even more time lost working to correct the mistakes that don't immediately rear their heads (fighting .NET quasi-memory leaks because RemoveHandler wasn't ever called?  Not calling EndInvoke() on delegates, etc...)

Unfortunately we've had a number of run-ins with "productivity boons" which we can't fit into out current systems.  Like Scott's WCF example we run into buggered implementations which prevent us from smoothly using the newer systems--often times these basterds are the product of green developers trying to get their first system to work, or the product of salty devs who learned how to make something work and just don't care if it's been done correectly.  It's difficult to learn how to do things correctly--it's harder to learn the correct way to do things than it is to actually do them.

To bring it all back around though...  having either a good mentor or a good resource can make a huge difference between stumbling around in the dark or heading in the right direction.  In my personal experience the best productivity gains don't come from new technolgies, but learning better implementations of the technoligies I'm already fluent in.

+1 for having more advanced talks on existing/older technologies.  Now just to define the scope of "Advanced"

In the video, the comment about "be able to get stuff done, get paid and move on" sums it up for me.

WPF just doesn't solve any problems my company or our customers have. I think that's why so many people want to stay with XP - it's not as slick but it does the job and there is no obvious benefit in upgrading.

Where I've had a need for some custom component on my forms, I've managed to write something (if it's relatively easy) or buy an existing component. My preference is to always buy something over building from scratch or to reuse something someone else has written.

If I was to write a new product from scratch, I would consider WPF but I suspect I'd stick with the tried-and-true WinForms.

Forms behaves the way most non-web designers work and think. It's intuitive and natural.

WPF is backwards and complicated - adding typically unneeded flexibility at the cost of significant complexity. If the dev studio team actually made the designers for it as simple and natural to use - I'd use it - but they're not.

I was at the .Net Rocks session last week and the presenters were doing the classic "bear video in button" demo and I challenged them to do it *without typing ANY XAML* and they failed. I knew they would because it's essentially impossible to do that demo without cutting XAML. But it's not just that - simple things - like embedding graphics in controls - or even positioning controls are amazingly backwards in WPF relative to Forms.

There's a lot of stuff in WPF I'd like to use - but there's so much weird baggage that in my opinion *wasn't necessary* that it's just not worth it to me.

Want some immediate examples?

When your new architecture *breaks the language paradigm* you might want to rethink what you're doing.

1) C# (and most .Net languages) have the concept of a Property. It's a way to encapsulate a value making it look like a varable, but with code behind it. This explicity replaces the old SetXXX() GetXXX() accessor methods you typically see strewn through C++ code.

Guess how the WPF system works? Yep. SetXXX() and GetXXX() all over the place.

2) I understand the philosophical underpinnings for the notion of a page owning the position properties of a control it hosts - but - in most development situations, the way people think about controls is where it is and how big it is. By moving "where it is" to the host, you break the previous paradigms - but worse, you've implemented something that's *logically* sound but *practically* unsound. To make it worse, *getting* those properties is surreal. Why not use *attributes* - something that's been in .Net for a long time - to handle this?

3) If you've used WPF for any length of time - you quickly realise that the entire design metaphor is for a *WEB PAGE*, not a desktop application. We've BEEN through this. The huge A-HA moment for the dev team was 1.1 to 2.0 when they realised that the golden age of everything running on a browser wasn't happening and that maybe desktop developers were important too.

4) The fact that you made database connectivity an order of magnitude more difficult - and have only fixed it in VS2010 (kind of - it's easier - but still not as easy) shows me you don't understand what the bread and butter of desktop apps is: DATABASES. Everything is a database and almost all applications are about how to get data into them - and how to display then nicely. The fact that WPF's designers couldn't simply let you access database content visually is a HUGE clue that someone is out of touch.

5) If you have to go into the code to do *anything* other than business logic - you've taken a step backwards. One of the main advantages of Forms is that I didn't have to do think about UI. I could slap down controls - hook most of it up in the property page, double click on the relevent stuff - maybe hook up a couple of events and bang - application.

NOW I have to cut XAML, I have to know two languages (XAML and C# and constantly switch between them), I have to figure out relationships between them - and if I really want to do a good job - I have to get Blend in the picture.

THIS IS NOT GOOD!

We've just gone back four years. The current crew doesn't understand that most application developers aren't web developers and don't WANT to be web developers. More importantly, the design goals and target audiences are entirely different and expect different behaviours in their apps. By trying to make desktop apps look like web apps - you're NOT helping us.

WPF could be the greatest thing since sliced bread - but the FIRST thing that has to happen is to understand why Forms are so popular and then make the starting configuration of WPF look like it... then let the developer turn on stuff they want.

The way it is right now - I'll use it when it is literally the last possible solution to my problem.

It's just not worth the effort to get things working.

 

Sorry - but I *LOVE* .Net. The people around me are sick of hearing about why I love it. And you're taking all the fun out of it for me. Yes, I'm ticked.

Disclaimer: My opinions and thoughts are my own and are not reflective of my employer.  My opinions are a result of being frustrated by the Framework or from Microsoft thinking that shinny is more important than support.

Productivity #1
Not everything is new and shiny!  Most of us work on brown field applications.  Green field applications are few and far between.  Brown field apps are mostly VB6 or Windows Forms, not WPF for me.  I learned MFC this year because I had too (yes that right, I learned MFC in 2009).  I would love to know how to make a Windows Forms app that looks like Firefox, Outlook, Word, or even Excel, but it’s difficult when tooling is inconsistent, and even when Microsoft internally can’t agree on a UI Framework.  I mean, you don’t even have the Office Ribbon in the Framework, hell, you gave MFC the ribbon before .NET, yet you preach .NET.

Productivity #2
The problem with WPF unlike Windows Forms is that the tools SUCK!  They are hard to use, expensive on system resources, and sluggish.  The Windows Forms designer is zippy and it's simple to get my stuff done.  I do want to have neat animations and transitions in my app, but I feel those should be provided by APIs like "ShowDialog()" not by me having to bake a transition in XAML.  Or even allow me to get them from some type of gallery.  In Windows Forms, I’ve never written code for the UI, I use the designer or I buy a third party control.  And if I want to do something cool in WPF I have to go buy Blend now?  I have spend more on a tool that just does UI design, I can’t get approval for that.  So that means that Visual Studio is just a glorified version of Notepad?  There are times when I load Notepad++ because I know the Studio won’t be usable for at least 45 seconds.  Cold start performance sucks.

Productivity #3
What you see in the designer is not what you get.  In the old days (by this I mean circa 1999), when you built a VB6 app, what the designer showed was what the app looked like, including window chrome.  You dragged a button out onto a form and where you dropped it was where it stuck.  And you could take that design and replicate it in a reasonable amount of time in Windows Forms.  In WPF if you want four buttons at the bottom of the screen like VCR controls, you need a stack panel first (orientated horizontal), and then you need to put those buttons in there.  That is a complete departure in how you think about Windows Apps.  We were trained that Windows Apps are grid-like and not web pages, and as such, they work differently.  Not to mention that in VB6 and Windows Forms, the designer looked exactly like the final result.  In WPF you get a white rectangle with a grey border that looks nothing like the final result when you press F5.  Also, I can't use Spy++ to inspect the elements in WPF.  When I do, I get "DirectUIHWND", what is that?  I wish that Spy++ worked like Firebugs in Firefox, now that would be useful.

Productivity #4
I want the speed of Visual Studio 6 with the tooling of today.  Today, it takes Visual Studio almost 45 seconds to be usable.  Think of it this way, would people use Excel if it took 45 seconds to be usable?  I can open a 45K or 45MB Workbook and the UI is still responsive in seconds.

Productivity #5
It seems that Microsoft is spending their time on things like LINQ instead of improving the tool.   And even that is inconsistent, because now we have the Entity Framework.  We ADO.NET, OLE DB, ODBC, LINQ, JET, and Entity Framework, to talk to databases.  There is no consistent way to get your data, so I use NHibernate, which is awesome compared to any of the above technologies.  I wish that more .NET stuff used configuration instead of attributes.  Also, there still is not LINQ provider for Access, which believe it or not is heavily used by many ISV in Oil & Gas.

Productivity #6
I really look to Microsoft to see what you can do with WPF and the new graphics library; I mean you wrote it for heaven’s sake!  How many people do you know didn't buy an Apple because the UI is sexy.  The transitions are sweet, the effects are well thought out (windows flip is a prime example) and the OS is generally nice to look at.  My Mac runs Windows (but if I want to cut video, like I did for Ping, I use iMovie).  If Microsoft wants developers to use WPF and get excited about it, then show us what you can do with it.  You guys built the technology; you should know how to make a textbox "light up" as you put it.

Productivity #7
Slow adoption of Windows Features to Framework Support.  I've ranted about this in the past, why is the Framework behind Windows features?  If Microsoft wants everyone to buy Vista or soon 7, then make those shinny Windows features accessible from .NET without requiring a PhD.  It's almost a three full years after Vista’s launch and we still don't have Command Links,  Dialogs, or Aero Wizards baked into the framework, we have to use Vista Bridge.  It just baffles my mind!  I hear radio shows talk about this (including .NET Rocks) and I have my clients ask the same questions, why can’t your app look like that.

Productivity #8
Why is Office Development so difficult?  I know almost no one who takes Excel, slaps a button on the UI and write .NET code inside it.  I know lots of developers who automate Excel to read in hundreds or even thousands of Workbooks, transfer that data to another application, maybe update some data, and then save that back to the Workbook and close it, without ever showing Excel. 
It is so fragile.  Why isn’t there a complete wrapper to talk to Excel or Word yet?  I’m so frustrated by VSTO I’m evaluating third party libraries to help me out.  The Excel 97-2003 file format isn’t XML like the new file format, and most of my clients are three or four versions back because the new Office doesn’t do anything the old one can’t.  COM is hard, the only people I know who use it or understand it are Microsoft, but yet we still have these fragile wrappers which take a PhD to understand.  I’d rather pay a third party a grend for a .NET wrapper (which is more than Office costs) because I can do things which seem backwards from .NET, or are just SLOW. 
It amazes me, we have Azure (which is Microsoft tying to be everything to everyone again) but we still don’t have a stable solution to read data from a Workbook.

Thanks for listening.  I will now go back to my desk Smiley

I tend to agree with Scott Belware's definition of productivity in the context of software development.

Getting the fewest number of keystrokes is a very narrow view of the problem. Of course it's hugely important to have expressive languages and good tools to quickly output code but it's only a small part of the overall picture of software development: the main aim of it all is not to reduced to allowing me to output more but to ensure that the entire ecosystem allows me to output a solution to a client's problem in the shortest possible time.

I'd like Microsoft focus a bit more on how all these great technologies they've been churning out in the past couple of years are actually working together to help build applications faster.

There is a lot of focus on introductory presentation on what they can do but very little in the way of showing us best practices and recipes around how they should be used efficiently.

The truth is that, while WPF, Silverlight, MVC, WCF, and al potentially hold great promise, they are not making us more productive for a few simple reasons:

Technologically Incomplete.

They are fairly new, so they do not always cater for all their promised used cases. You cannot be sure that the productivity that was promised using a particular technology will not be negated by specific issues that have not yet been ironed-out. You'll end-up spending a huge amount of time going around these bumps.

Lack of Proficiency.

We don't know them. Any new language, development paradigm and technology (even tool) will take hundreds, sometimes thousands, of hours to master well enough that you don't have to spend 50% of your time Googgling (or Bingging) for help.
By the time you're somewhat proficient enough to produce code quickly and avoid pitfalls, some other new shiny technology will have taken over. Corba is dead, vive Remoting! Remoting is dead, vive WCF!

Negligence of older technology.

As developers we like shiny new toys. I'd rather spend my time experimenting with C#4.0 than type another line of VBA. Yet, most existing software is based on these older technologies, and most developers spend their time supporting and developing new solutions using them.
Windows Forms are not dead. Maybe we wish they were, they're messy, unsexy and built upon layers of old technologies, yet they're still there, making up probably more than 90% of the desktop apps out there.
Strange thing is that, as noted in the video, they are conspicuously absent from the big events.

Isolated Islands

There isn't enough information about combining technologies together to build real-world apps.
Examples, code samples, presentations usually focus on showing the first 10% of solving a problem with a particular technology.This is useful but when we reach the point of having to plug these technologies together, there isn't much help.

Keeping up with it all

We're only human and there is only so much information we can consume every day while still performing our primary job.
I try hard to keep up with technologies because they sometime give you the edge, or render something that used to be complicated easy.
Unfortunately, this comes at a price: I spend a good deal of my day reading on stuff I probably won't use; there's too much of it, too many new technologies, too many ways to do things, how do you make the right choice?
It's somewhat paradoxical: you need to spend time trying to learn about new things that may make you more productive and in the process you are not doing any work.

Helping me choose

I would really like to see some kind of 'Microsoft Academy'. By this I don't mean a 'Police Academy' type of affair but rather a training video channel where, over the course of a number of videos, we would be shown how to use the technologies to produce real-world apps.
Sessions during technical event are too short to go beyond the very basics. Even Scott's presentation on building NerdDinner had lots of ready-baked cheats that hide most of the real-world process of getting through a technology choice.
My productivity is greatly affected by the right or wrong technologies I chose.

Anyway, this short video has provoked a lot of long responses.
That must be the Hanselman Effect!

Microsoft Communities