Coffeehouse Thread

138 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Do you find WPF to be unnatural / unlogical?

Back to Forum: Coffeehouse
  • User profile image
    DeathBy​VisualStudio

    @W3bbo: Damn straight!

    You almost have to have a dedicated XAML/UX guy on staff for even the most trial of applications. I've also had some performance fun with UIAutomation performance related issues. (UIAutomation is the snooping Windows technology that let's apps like screen readers, user accessibility apps, and things around touch snoop into your app) UIAutomation has bugs that can also slow your app down. You don't have any control over it other than writing some hackery to try and block it from peering into your app and in the process preventing those with accessibility issues from using your app. This has been a problem since .Net 3.5 and wasn't fixed in 4.0. Here's one flavor of it http://social.msdn.microsoft.com/Forums/en-NZ/windowsaccessibilityandautomation/thread/6c4465e2-207c-4277-a67f-e0f55eff0110. I can make my app's combobox drop down render time go from sub seconds to minutes just by plugging in my digitizer.

    Oh and don't get me started on the simplicity of the UI thread, dispatcher, et all... I'm all for a fluid user interface but displaying the hour glass in a WPF/MVVM application should be so damn expensive to code.

    Don't get me wrong: I beleive WPF is the right idea but it's way to expensive to use to develop most business applications.

  • User profile image
    W3bbo

    Don't get me wrong: I beleive WPF is the right idea but it's way to expensive to use to develop most business applications.

    The biggest shame is how Microsoft decided to reinvent the wheel when all it needed to do was brush up DirectUI, which would have provided next-generation UIs to Native applications, as well as that "Proto-WPF" that's been present in Windows Media Center and the Zune desktop software for some time now.

    If I were in Microsoft's position, I would recreate Windows' windowing engine as a compositing system with inherent 3D support with a similar architecture to WPF, and then provide CLR bindings on-top. It worked for WinForms.

  • User profile image
    spivonious

    I used to think the same things about WPF - slow, hard to write, illogical.

    I read books, read every blog I could find, wrote toy apps, and months later it finally clicked.

    Forget Winforms. You need to approach WPF apps differently from the start. The learning curve is huge but once you "get" it, it makes developing apps so much easier. DataTemplates changed my world. I didn't understand the point of Commands until I learned the MVVM pattern. Now I almost never use events in my UI.

  • User profile image
    DeathBy​VisualStudio

    , spivonious wrote 

    I didn't understand the point of Commands until I learned the MVVM pattern. Now I almost never use events in my UI.

    Yeah!!! Attached behaviors for all of those things that need commanding that aren't commandable!!! Whohoo!!! How many more things do I need to know about/create to do my job? WPF is just one exception after the next... Binding CommandParameters works great too...oh wait.

  • User profile image
    spivonious

    , DeathBy​VisualStudio wrote

    *snip*

    Yeah!!! Attached behaviors for all of those things that need commanding that aren't commandable!!! Whohoo!!! How many more things do I need to know about/create to do my job? WPF is just one exception after the next... Binding CommandParameters works great too...oh wait.

    A little bit of education now saves a ton of time in the future. Binding Command parameters couldn't be simpler, so I'm not sure why you're implying it's not.

  • User profile image
    earnshaw

    It is quite unusual these day for moderne "advances" in software technology to be adequately documented.   

  • User profile image
    brian.​shapiro

    @Ken Elmy:

    You don't even have to use commands though.

    All of the different aspects of WPF are just there to make things easier once you get used to them. But if you don't, then you can always do things through brute force.

  • User profile image
    Bass

    If WPF is so great, where are all the killer WPF apps?

    Hasn't it been something like 5 years already since WPF was first released?

  • User profile image
    DeathBy​VisualStudio

    @spivonious:

    I don't know why you're implying that it's a matter of education that makes the difference in understanding commanding, et al with WPF. The fact is you can't always directly bind the command parameter. Sometimes you have to do additional work such as described here: http://www.wpfmentor.com/2009/01/how-to-add-binding-to-commandparameter.html

    @brian.shapiro:

    It's not a question of "easy". It's a question of cost. You don't lower your development costs by "getting used to" all of the exceptions and quirks in WPF.

    @Bass: +1

    Don't get me wrong I really want to write fluid, good looking, modern apps with WPF but where it stands right now it's just not cost effective for most business apps.

    If we all believed in unicorns and fairies the world would be a better place.
    Last modified
  • User profile image
    W3bbo

    , Bass wrote

    If WPF is so great, where are all the killer WPF apps?

    Hasn't it been something like 5 years already since WPF was first released?

    I'm already seeing WPF being used more for quick internal applications, so at least developers are toying with it, but as it stands it's still hard to design WPF applications.

    Having tried the (awful) WPF designers in both VS2008 and VS2010 it's no wonder adoption is so low. I also imagine the .NET 3 requirement doesn't help things either: XP users have a potential 350MB install requirement.

    I see WPF now as being where ASP.NET was in the 1.1 days: shunned by the 'passionate' people because it's a lot of work to get it to do what you want it to (this was before Control Adapters and improved standards compliance). I imagine we'll see an update to WPF in VS2012 that makes WPF easier to work with, a kind of "WPF MVC"-style relaunch.

  • User profile image
    brian.​shapiro

    @DeathByVisualStudio:

    The savings in cost is reusability. WPF is a fully object oriented, thread-safe framework , and thats the point of the whole thing.

    But you don't have to use Commands at all if you don't want to.

  • User profile image
    magicalclick

    , Bass wrote

    If WPF is so great, where are all the killer WPF apps?

    Hasn't it been something like 5 years already since WPF was first released?

    Most of newer version of Accounting/Warehous/Inventory systems are using WPF. Assume the campany is new, not a 1998 company.

    Leaving WM on 5/2018 if no apps, no dedicated billboards where I drive, no Store name.
    Last modified
  • User profile image
    DeathBy​VisualStudio

    @brian.shapiro:

    Unless you're building something small like Northwind you have to develop a lot of (yes re-usable) components before your users see screens coming out of your development efforts. Customers paying for business solutions don't care if the framework you are using is fully object oriented and thread safe. Such things only matter to the academic.

    And thread-safe? Now there's a feature! The framework maybe "thread-safe" but it also adds another level of complexity when it comes to threading because now each and every bit of code I write I've got to be painfully aware of what needs to be dispatched on the UI thread vs. what I can run in the background. Take collection views as an example; they're collections but yet you can't do much with them unless the operations you perform on them are done so on the UI thread. Want to refresh them in a worker thread? Good luck with that.

    Sure you can forego a lot of things in WPF. You can even build yourself a nice non-reusable ball of mud. I guess I'm hoping that Microsoft's framework and tools developers would consider how the whole ecosystem works together to provide its customers a cost-effect means to create software for business. Relative to Microsoft's past work WPF isn't there yet regardless on how object oriented and thread-safe it is. 

    If we all believed in unicorns and fairies the world would be a better place.
    Last modified
  • User profile image
    magicalclick

    @DeathByVisualStudio:

    Thread safe is for acedemics? Come on, if you screw up syncing the threads, your best senario is application crashed, the worse is it keeps running but the numbers are all wrong, and the worst case is it updates back to database for months until accounting auditor comes and realize something is not right. The mess is extrememly scary.

    Try this link.....

    http://www.codeproject.com/KB/WPF/podder2.aspx

    A proper bigger project should be styleless built-in and user controlls. And finally completely change the skin by art designers using Expression.

    Leaving WM on 5/2018 if no apps, no dedicated billboards where I drive, no Store name.
    Last modified
  • User profile image
    brian.​shapiro

    Take collection views as an example; they're collections but yet you can't do much with them unless the operations you perform on them are done so on the UI thread. Want to refresh them in a worker thread? Good luck with that.

    There are examples online on how to modify an observable collection in a way that they can be refreshed on a worker thread if you really want to implement that.

  • User profile image
    W3bbo

    Thread safe is for acedemics? Come on, if you screw up syncing the threads, your best senario is application crashed, the worse is it keeps running but the numbers are all wrong, and the worst case is it updates back to database for months until accounting auditor comes and realize something is not right. The mess is extrememly scary.

     

    You miss the point he was making. While it's all well-and-good that WPF is somehow 'inherently' thread-safe, it has a downside of actually making it harder to get stuff done right (and so potentially makes the consequences worse as you have even more complicated code to wade through). So whilst having a "safe" system is interesting from an academic perpsective (think: Haskell-types) little attention has been paid towards it practical uses and 'programmer usability'.

    To paraphrase an old saying: "WinForms makes it easy to shoot yourself in the foot. WPF makes it harder, but when you do you blow your head off instead."

     

    A proper bigger project should be styleless built-in and user controlls. And finally completely change the skin by art designers using Expression.

    Now you miss the point I've been making: only a tiny, tiny minority of code shops have actual designers. Those that do are probably making consumer-facing products that wouldn't use WPF anyway. WPF's greatest advantage is the databinding support, which is largely used for internal applications, which have historically always had their UIs designed by the people who're writing the code for it. This isn't like web-work where an internal IT department would have a dedicated "HTML guy" who is separate from their "ASP code guy". Clearly Microsoft wanted to see this pattern being used for desktop apps, but they're mistaken.

    Also it's hard to develop good looking controls for WPF, even less so to make properly "style-less" controls. Things were so much simpler even a few years ago where all you had to do was immediate-mode graphics for shapes, and the System Colors and Visual Styles APIs for UI components. You didn't have to think for yourself to get good results.

    There's a reason why Mac OS X only has one style, and I don't understand why Windows 7 ostensibly supports other visual styles even though Microsft would never release anything besides Aero for fear of breaking all the poorly-developed applications that make that assumption *COUGH* Microsoft Office.

  • User profile image
    DeathBy​VisualStudio

    Let me start off by saying "nevermind" and thanks W3bbo for a much more concise and well thought out set of points than my dribble below. I would have hit "post" sooner but was interuppted by the practicalities of an actual life.

    @magicalclick:
    You're missing the point. "Thread safe" is just some techno buzzword to my customers.  What matters to them is the cost to build a screen or implement feature X. Trying to explain that WPF is thread safe to them is academic at best. The fact is that having to understand WPF's threading nuances, manage locks, and be aware of what operations need to be run on the UI thread raises the cost of development.

    You’re right about one thing: threading is extremely important stuff not to mess up but again that's not my point. WPF should make it easier for me to get the benefits that WPF has to offer without having to write, workaround, and be aware of threading so much. While some may say "think of all of the things you can do" you rightly frame it as "think of all of the things you can screw up."

    I’m not suggesting we go back to the single threaded days of VB6. What I am saying is that the architects of this technology really need to take a broader view at the cost of this technology rather than how an individual feature helps us around a pinch-point. The components that comprise WPF need to work together more consistently and predictably rather than the trial and error that it is today.

    "And finally completely change the skin by art designers using Expression."

    Thanks for underscoring my sentiment that you need a dedicated UX person or persons to pull off a WPF project. What happens on smaller projects? Are they stuck using the crappy built-in designer? Do they acquiesce and write XAML instead. Do they give up weekend after weekend of family time in order to learn Blend? (No time during the week of course dodging WPF potholes).

    @brain.shapiro:
    Sure I could work around the problem of refreshing a collection view in the background many different ways but my point is I shouldn’t have to.

    Guys I've spent the last year and a half working with WPF so I'm not totally foreign to the framework. On the contrary that’s why I know it has issues.

    But alas I digress because in the end I’m just holding it wrong…

    If we all believed in unicorns and fairies the world would be a better place.
    Last modified
  • User profile image
    Dexter

    While it's all well-and-good that WPF is somehow 'inherently' thread-safe, it has a downside of actually making it harder to get stuff done right (and so potentially makes the consequences worse as you have even more complicated code to wade through).

    So you're telling me that you prefer WinForms "multithreading"?! That is, accesing a control from a different thread is not allowed in theory but in practice it works or not depending on the control type, windows version and the phase of the moon.

     

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.