11 ms·
I Rewrote WinUI to WPF
- trulyrandom 5y agoLooks sharp! I've worked with WPF quite a bit in the past and still think it's the nicest UI framework from a developer perspective. How's the performance these days? Compared to plain Win32 applications, I remember it feeling very sluggish once your WPF application has a few dozen controls.
- spaetzleesser 5y agoIt’s still slow to start up. That’s partially because of .NET in general. There is a lot of code to read and JIT before a .NET application runs.
- mattmanser 5y agoYou're like 5 years behind, .Net has been snappy for years since core released.
- alophawen 5y ago.Net != .Net Core, even though they rebranded it as such. That's just revisionist marketing
- jcelerier 5y agoWhat's a snappy .net app ? The few ones I know definitely feel slower than e.g. Qt apps
- ripley12 5y agoPaint.NET is probably the best example of a good, fast widely used .NET app.
- jcelerier 5y agoThat's the first example of "not fast" that came to my mind actually.
- ripley12 5y agoSeriously? The effort Rick puts into Paint.NET performance is unreal (check out his Twitter sometime). I've found it to be impressively fast, especially for how much functionality it has. FWIW it was only recently migrated to a modern .NET version, give the latest version a spin if you haven't already.
- filmgirlcw 5y agoAgreed. Rick’s work on Paint.NET is just so impressive.
- spaetzleesser 5y agoPaint.NET is a good example for how much effort it takes to develop a .NET app that has decent performance especially once it is a little bit complex
- oneplane 5y agoJust because it's impressive doesn't mean it's not slower than other systems. It's not mutually exclusive.
- vxNsr 5y agoOdd, I've been using it for the better part of a decade when GIMP is too much and I've never felt like it was slow.
- fistynuts 5y agoIndeed, if anything is slow, it's GIMP.
- boznz 5y agoMore like hardware is now hiding the .Nets overheads
- zip1234 5y agoNo, both have gotten much faster. This is just one release of performance improvements: https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-6/ https://devblogs.microsoft.com/dotnet/performance-improvemen... It is worth noting that WPF can run on this latest version of .NET
- spaetzleesser 5y ago“Snappy” is subjective. It definitely has improved But it’s still far away from what you could do with Win32 or MFC.
- ripley12 5y agoI think that's only partially right. .NET apps can be published with AOT code (ReadyToRun). WPF apps are still pretty slow to launch with ReadyToRun enabled; I haven't profiled it to see why, but I suspect it has a lot more to do with WPF (somewhat abandoned for a decade, and the XAML bits have always been slow) than .NET. In my experience the JIT penalty at startup isn't as bad as people think, the .NET JIT compiler is really fast and the average console app is very quick to start up.
- layoric 5y agoReally? I did about a year of it and I must admit it was not a fun year (~2014, so a while ago). Styles and binding were so overly verbose, and I felt like I was constantly fighting the tooling. The dev loop was horrible compared to anything related to building UIs for web apps. Interested in your experience and why you think it is a really nice UI framework from a developer perspective?
- TravHatesMe 5y agoWPF was ahead of its time when it was released in 2006. It might have been the first to use data bindings and popularize the MVVM pattern. Web UI frameworks were barely in existence and webpages typically didn't have that desktop-y/SPA feel. WPF was king for a while until web took over.
- DaiPlusPlus 5y agoDeclarative data-binding wasn't anything new in WPF: it significantly postdates ASP.NET WebForms which had declarative data-binding, though, yes: the web doesn't count because web UIs aren't stateful in-memory on the server. I feel MVVM is an anti-pattern: it necessitates long-lifed mutable instance state (the object of the class of your view-model) which is much harder to reason about (for example, try updating a bunch of properties in response to another property getting updating), but for me, the worst part is the inability to differentiate or identify the source or origin of new data that appear in a property setter: it's very difficult to determine if a TextBox TextChanged event came from a user-initiated action, was set by another method in the class - or was a knock-on property change - because a property setter doesn't have an EventArgs parameter. This can cause ViewModel event-handlers to get caught-up in infinite-loops or at the very least sending large amounts of inconsequential and unnecessary event-messages around and invoking (potentially expensive) property-setters and getters. I still agree that MVVM was a huge improvement over simply subclassing widgets and windows like we do in WinForms, VB6, Delphi, and JWT/Swing - but all MVVM brings you is separation between UI and Business/Domain in name-only; your ViewModels are still inevitably going to end-up with dozens of new properties bound to sone arbitrary presentational XAML attributes. XAML alone is a decade past it’s time. It’s hugely verbose and is filled with so many gotchas (wanna bind a bool property to a control’s visible/hidden state? Not without an extra 50+ chars of binding params and value-converters). XAML also falls for the pitfall of assuming a GUI can always be modelled as a strict hierarchy of containers and controls. Overall, XAML feels like what the Microsoft of the mid-to-late 1990s wanted to turn HTML into. ——— I hope I don't sound like another React fanboy (and I personally use Redux, not React)- and I'll argue that modelling state as a history of immutable, almost serialized, state trees is fantastic for so many things - especially typical database/business application work, but it's also utterly inappropriate for so many other kinds of applications (like, you wouldn't serialize the entire state of a raster image of HTML <canvas>, or re-run an append-only list of drawing instructions (like PostScript/Windows Metafile) for Canvas 2D context or even WebGL - BUT overall the Reflux/Redux/React design of a strict one-way flow of data and state brings so much clarity and makes it easy to see how different components (even in an abstract sense) interact with each other: they don't! It really does force you into a better way of thinking about program code, state and flow. —— Not that it matters: Microsoft has completely dropped the ball on keeping the Win32 desktop dev-story alive. WinForms is uncool and terrible but there is no faster alternative for putting together a quick simple form in an EXE. If you use WPF you’d still be trying to get MahApps working, ----- > Web UI frameworks were barely in existence and webpages typically didn't have that desktop-y/SPA feel. WPF was king for a while until web took over 2005-2006 was after the start of "Web 2.0" and after AJAX had been established - but mostly: when Firefox had already been out for 2-3 years and for that companies that were willing to go all-in on Firefox for their users, they really could have have desktop-quality SPAs made using Firefox's massively superior support for modern CSS techniques that IE6 had avoided for over 5 years at that point - can you imagine Google not releasing a Chrome update for 5 years? So it was IE6's fault that better SPAs weren't around on the Internet - but it was also IE6's fault that so many companies had the 1990s near-equivalent of an SPA: ActiveX-heavy intranet sites that only worked in IE6. That point amuses me.
- pipeline_peak 5y agoAs a WPF developer, is it really modern though? Everyday at work I feel like I’m on the Titanic. Well built, well designed, but sinking.
- int_19h 5y agoHow is it sinking, though? It's not getting improvements, but that's a very different thing.
- ripley12 5y agoIt's a similar thing IMO. WPF is understaffed to the point where it might as well be dead in my mind. It hasn't received major new features in a decade. It's currently owned by the Windows team (not the .NET team) and they have staffed it with a skeleton crew. They don't even have bandwidth to review most community PRs. Even the .NET team doesn't get responses to issues they raise on the WPF repo: https://github.com/dotnet/wpf/issues/3811 https://github.com/dotnet/wpf/issues/3811 Adding to all that, WPF has a massive dependency on C++/CLI which means it cannot take advantage of many new .NET features until that is rewritten. And from what I can tell (from the outside) that will never happen.
- pjmlp 5y agoAt least C++/CLI isn't like the C++/WinRT dependency on WinUI/UWP. Editing IDL files without VS tooling just like in the good old COM days pre-.NET, lovely.
- int_19h 5y agoThis is all true, but the framework doesn't just stop working because of that, and the tooling continues to support it. Hell, even WinForms is still chugging along, remaining a valid way to write desktop apps for Windows - and it has been in similar limbo for much longer.
- pipeline_peak 5y agoYeah, but like WPF, very little companies are writing promising new software using WinForms. I stripped my resume of anything WinForm related because I kept getting god damn DoD legacy-ware jobs.
- fassssst 5y agoAlternatively you can use WinUI within a WPF app using XAML Islands. Enables you to incrementally migrate away from WPF towards a WinUI 3-based app.
- ripley12 5y agoDown that path lies madness. Everyone I know who works with XAML Islands despises it. MS doesn't really push it because it's very broken.
- zogomoox 5y agoStarting any GUI app development on Windows is very frustrating right now.. Winforms (dead, ugly), WPF (nearly dead), UWP (deprecated), WinUI2 (deprecated), WinUI 3 (buggy, maybe in a year), .NET MAUI (also immature).
- ripley12 5y agoYeah, it's a mess. Personally I think web UI via WebView2 is the only way forward; Chromium is far and away the most powerful UI framework shipping with Windows these days. Even if "native" UI frameworks were doing everything right, it's hard to compete with all the investments in Chromium. P.S. WinForms isn't dead; it's maintained by the .NET team and it gets a lot more attention than WPF. But, well, it's WinForms :)
- p1peridine 5y ago> Winforms (dead, ugly) Dead? Nonsense. WinForms is the most used technology/framework in 2021 for desktop GUI applications according to jetbrains. https://www.jetbrains.com/lp/devecosystem-2021/csharp/ https://www.jetbrains.com/lp/devecosystem-2021/csharp/ Also: https://blog.submain.com/death-winforms-greatly-exaggerated/ https://blog.submain.com/death-winforms-greatly-exaggerated/
- georgemcbay 5y agoDead and ugly are both kind of vague terms open for debate so I'm not arguing your main point here (and I'm not the person you responded to) ... ... but as someone who did a lot of Win32/UI App programming back in the late 1990s and early 2000s (up to and including early WinForms), I recently looked through the landscape of available UI toolkits and can confirm that as someone who hasn't been keeping up with this stuff for years its INCREDIBLY confusing as to what technology you should build new projects on looking through the graveyard of half abandoned aborted starts Microsoft seems to have made from back then until now, with almost everything being officially deprecated or early access/unfinished. The fact that WinForms might still be the best solution for starting a new project on is more of a condemnation of Microsoft's combined efforts in this area than it is something to be celebrated, IMO.
- chiph 5y agoIt's good looking. But I need a grid control because my users want everything on one screen. (joking, not-joking)
- jmnicolas 5y ago> (joking, not-joking) So it's a Schrodinger joke?
- xodltus 5y agoLoL...
- TheDesolate0 5y agoWhy?
- miguelrochefort 5y agoHave you seen Uno Platform? It ports WinUI to iOS, Android, WebAssembly, macOS, and Linux. https://github.com/unoplatform/uno https://github.com/unoplatform/uno
- e12e 5y agoRecent release/discussion: "Uno platform 4": https://news.ycombinator.com/item?id=29405909 https://news.ycombinator.com/item?id=29405909 Tbh, it looks like another "worse than freepascal / Delphi" solution... But maybe I've just given up on gui-stacks.
- oneplane 5y agoBut then you'd have WinUI in even more places where it doesn't fit. Why would someone footgun themselves like that? I get that some people might personally like it but it's going to be 'the odd one out' at best.
- NWoodsman 5y agoI built an awesome WPF note-taking/ idea aggregation app. Any idea how I can get it some exposure?
- lostmsu 5y agoJust publish to Windows Store.
- schleck8 5y agoReddit, Show HN, Producthunt, alternativeto.net
- NWoodsman 5y agoYes, but I can't pass around an .exe nor am I willing to allow open builds from source, so maybe.....a YouTube video? Seems HN would downvote a Yt link, favoring interactivity. What do?
- square_usual 5y agoSet up a github pages blog with screenshots, a brief description and a download link. Then post it on Show HN! I try out nearly every note taking app posted there. (Though a Windows-only one might be difficult to...)
- e12e 5y agoDistribute through ms store? https://developer.microsoft.com/en-gb/microsoft-store/overview/ https://developer.microsoft.com/en-gb/microsoft-store/overvi... (although I couldn't find an actual tutorial on "I have an exe, how can I publish in store" - it should support legacy (non uwp) apps now). I'm sure someone here will have actual experience doing this..?
- oneplane 5y agoWhile I admire the work that goes into things like this I can't help to find the look of WinUI to feel like "yet another random Electron app". It's so in-between of everything that it doesn't really fit anywhere, except maybe one of the 2005 convertible laptops that can take a tablet UI and still make you use a keyboard and mouse...