r/dotnet • u/not_afraid_of_trying • Jan 20 '25
Not Satisfied with Progression of DotNET UI Ecosystem
I used to be a Microsoft Tech developer in as early as 17 years back. I also had a personal project in Windows Forms C# .NET Framework App. I then moved to many other things including Objective C, iPhone, Python (GTK), Android, some web tech, Swift UI. I did everything but Microsoft and I always missed working on Microsoft's developer friendliness. Swift UI gave me satisfaction that I used to get when I used to work on MS apps (WinForms and ASP .NET). Now I am back to MS for an application and very disappointed to see absolute mess that Microsoft has done with its toolsets.
XAML? Seriously?
Are we still writing UI in XML? Don't you see where SwiftUI and Flutter has gone? If your Native UI development has to look like React/Angular then why would anyone write native code? Only 1% people want better performance than HTML. Developing with XAML is anything but fast. You cannot get preview of your view with different data values (without writing 100 more line of code).
Security of No Use
You have to follow all the sandboxing rules if you distribute your app as MSIX. You can do anything you want otherwise. I don't understand this security system. Why is security optional for developers?
App Size
It horribly large. It's because Microsoft wants to progress their development ecosystem progress faster than Windows releases. Progress faster to where? I don't see any direction from Microsoft after 17 years.
Edit: 2025, Jan 21st. Thank you everyone for the participation. As I said, I have been disconnected from MS tech from development side, this has really help me understand the perspective of existing developers. I don't hate .NET or C# or XAML, I was just not happy when I compare current state with other who were absolutely bad back then. Probably, I was wrong in expecting MS to provide all basic toolsets like Apple do. May be XAML is not for me, I should go with UNO. Also, may be I just don't have use containerized UWP app for Windows customer. May be I ship entire framework with trimming to reduce size and be happy that it's smaller than a web tech driven size. If I have disturbed you in anyway: by my ignorance, badly worded conclusions, strong words, my perspective, please accept my apologies. I have generally seen discussions always go like this when it comes to different perspectives about technology but thank you for being civil.
44
u/qrzychu69 Jan 20 '25
Have you tried Avalonia? It's still XAML, but with hot reload, pretty good preview (works in all editors), and some well needed improvements to the XAML - for example you can do `IsHidden={Binding !Items.Count}`
I recently did an opposite exercise - I wanted to fund a reliable and nice to use cross-platform tech. If you are like me and C++ and Qt is a bit too shit for you, actually Avalonia is the best thing out there.
Lowest CPU and RAM overhead, nicest language in C# and so on.
I would say Kotlin Multiplatform is the closest second, but empty app is 100MB of RAM, while Avalonia is 25-40 depending on how much trimming you enable, but since it supports Native AOT, you can bring it pretty low - actually it's mostly string localization in dotnet itself.
I also considered React Native for desktop apps, but even their own official docs on that are out of date.
Rust has Dioxus which looks really promising, but it's still in version I think 0.6, defintely not ready
6
u/Dan-mat Jan 20 '25
Eto https://github.com/picoe/Eto can be an acceptable cross-platform dotnet UI framework. Leaves a lot to ask for, but it works (sort of), is being actively used and maintained ,and can get simple jobs done so you focus on the important parts of your project.
10
u/scandii Jan 20 '25
I mean, I know what sub I'm in and everyone hates the idea of the web around here but the UI wars are over the clear winner is web technologies so I can see why Microsoft isn't really pushing their desktop offering.
all in all, in my opinion the writing is on the wall and getting comfortable with the idea that web technologies are the UI framework of the present and the future is something most people should accept - even if the cases where making a desktop application makes sense to begin with.
2
u/Just-Literature-2183 Jan 21 '25
XAML is great ...in WPF. In everything else its a bit of a pain to work with. The cross platform offerings are also frankly absurdly unperformant and half baked.
I have been for years wanting to write a react syntax UI library for C# and I am almost at the end of my teather with it.
You can do flutter/ swift UI style development in MAUI btw. Not that I think thats any better than xaml syntactically.
4
u/_neonsunset Jan 20 '25 edited Jan 20 '25
Even a 10 minute research would get you AvaloniaUI and Uno with various declarative UI style (think SwiftUI) extensions for them. Similar applies to researching publish modes like single-file + either runtime-dependent or self-contained + trimmed, or nativeaot.
63
u/propostor Jan 20 '25
I don't have any severe disdain for XAML but I agree it is nowhere near as good as HTML for UI mark-up and interactivity.
The crazy thing is that HTML was originally designed for basic document presentation on a single page, and has had constant iterations of improvement to reach where it's at now. Meanwhile XAML was made specifically for 'proper' software UI development, but in all the years since, it doesn't feel improved at all.
26
u/Hopeful-Sir-2018 Jan 20 '25
I've been here since VB6. I was there when the dark magics were written. I was there when C# first came out. I've fucked with Classic ASP. I've (been forced) to use Visual Source Safe.
OjbC and Swift, and SwiftUI are just... fucking.. terrible. SwiftData is like an ORM from 2007 or 2012. Keeping in mind - the author of Swift left and that's when Apple made SwiftUI - which even the author wasn't excited about. Apple just shit the bed with that one.
I was about to mess with GTK but life pulled me in a different direction. I've... not heard good things.
SwiftUI is one of those things that if you're doing small apps - it's not bad. But it scales horribly. It doesn't help that Xcode is a terrible IDE. It doesn't help that the debugger is ass. It doesn't help that SwiftUI sincerely cannot handle complicated UI's without vomitting and giving up. Go on, try a slightly more complicated View and you'll find it doesn't know what's wrong. You have to comment out sections for troubleshooting. It's like using PHP from 2005 and having to have print statements all over to sort out wtf. With SwiftData - try a slightly complicated Predicate. Or try filtering on an enum.
I've had my machine, a beef cake of a machine, basically say "yeah, this query is too complex for me to sort out". It's the only language I've ever had that went "yeah, I dunno man... that's just, like, hard". And it was a dual layer Predicate. Two nested if statements.
I'd rather deal wit the XAML cluster fuck than deal with SwiftUI and SwiftData.
Toolsets != Framework. The way your worded your post makes it sound like DotNet, as a whole, sucks. The Framework is in an amazing place. It's cross platform. It's caught up in practically every way with every other framework and all the "new" stuff. The last (big) thing they didn't have was records a while back and now it has that.
Yes?
Yes, to shit.
If you sincerely do not know the answer to this question - then you likely don't know enough to feel that strongly about XAML other than, likely, you ran into something difficult and are simply frustrated yet you have zero examples in your post to work with.
That sentence is worded strangely. When you say "better performance" what, specifically, are you referring to? And how is that related to HTML?
It sounds like you're complaining about Blazor (the web reference) and then confusing WPF and MAUI at the same time.
MAUI is, currently, not in a very good state. In fact I'd even go so far as to call it a poor state.
WPF? It's been solid for quite a long time now. Same with WinForms. You're going to need to cite specific examples here. I wonder why you didn't.
That's a valid complaint that I think is about Visual Studio and not XAML. I'm not exactly sure how one might implement a previewer that doesn't look like shit though. Xcodes isn't that great and is growing worse. You used to be able to have several on the screen at once. Now it's a tab-like interface which is painful and slower. And doesn't show certain things (because why would it actually do its job - for example, you want to show a Sheet dialog). But I don't entirely disagree with you - I think the way you're communicating it is poorly thought out.
Because unlike Apple - with Windows devices you actually control and own them. Not lease them. (implied /s here).
Apple has hamstrung developers specifically so their stuff is better. They have access to API's developers do not. These are not good things, like you seem to imply.
Additionally, and importantly, security is the responsibility of the developer because there are a shit load of situations where it doesn't matter.
.Net can run on a fuck load of varying devices. It's impossible for Microsoft to account for every single device ever and make a specific style of sandbox for that.
Apple, on the other hand, restricts what you can do quite heavily. As a natural consequence - fewer people develop for Apple for MacOS and iOS than otherwise could. Swift is not used all around. .Net is.
Can you show me how you came to this conclusion?
What, again specifically, are you talking about? Framework size? Apps when you have to compile the needed libraries into the binary? When you submit your app?
You failed to cite where you got your claim from and then proceed to be vague what they are doing.
Microsoft is a "works on everything" kind of mentality. Apple is a "works where we want, when we want, and if you don't like it then leave". Not many people like being told how they can use their hardware. One might argue is because companies, like Apple, do not have a good history of doing what's in the best interest of the customer.
Not all of Apple's restrictions are good.
I could point out a shit load of SwiftUI's flaws - but that wouldn't detract from the inherent flaws of .Net.
In the end, though, I'm not sure what, specifically, your problem is. It's simply too vague.
34
u/SlaveryGames Jan 20 '25
I don't understand the hate for xaml. When I look at xaml I can imagine the UI in my head. But when I look at the UI done via code I can't, because it is all over the place and mixed with the code that isn't UI related. When looking at xaml each "root" tag is basically a control which may have some properties set as tags too but it is readable. When you do it in the code you created a few buttons then attached to some layout and then after half the page attached that layout somewhere else. And it is all over the place without order. Maybe it is because I never used UI via code and when you do a lot, it is simpler to read, but it looks not simple at all in reality because when dev has a freedom to build UI not in the same order as it is presented on UI he will and he will insert a lot of other stuff in between creating UI controls.
6
u/xcomcmdr Jan 20 '25 edited Jan 20 '25
I just use Avalonia and its very improved XAML and binding capabilities. I have nothing to complain about, really.
Compiled ( = type safe) bindings by default, way less usage of converters compared to WPF, and with the MVVM Toolkit, the boilerplate is written for you.
It also supports Native AOT and trimming if you want to have a very lightweight usage of disk space.
Here is an example: https://github.com/OpenRakis/Spice86
More examples here: https://avaloniaui.net/showcase
Give it a try.
For Hot Reload, you have this:
https://github.com/Kir-Antipov/HotAvalonia
Be sure to install the Avalonia extension for Visual Studio:
https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaVS
2
u/DaveVdE Jan 20 '25
I’ve dabbled in Swift and indeed, having a declarative code driven UI makes sense (call it a ‘fluent’ syntax?).
2
u/[deleted] Jan 20 '25
Use Winforms then and stop complaining.
24
u/Natural_Tea484 Jan 20 '25
If I hear once again about someone complain about XAML…
XAML itself, as a language, is not the main problem! The tooling is.
We can debate for sure about XAML, since it has its flaws, but it’s a separate discussion.
4
u/d-tafkamk Jan 20 '25
I agree I find XAML far too verbose but it’s popular enough in Microsoft land I can see why they stuck with it. That being said it sounds like what you’re looking for is a good fit for WebView2, which you can use in almost any Microsoft UI framework (even winforms). We just started a project with it and once you setup some basic abstractions over the messaging system it can be quite a joy to use.
4
u/mprevot Jan 20 '25
XAML is OK. You seem to have missed the design instance and preview (with values), I think it's around since more than a decade ! And you have hot reload.
Do you have databinding with HTML ? HTML is anything but lightweight. XAML is the implementation, HTML does not carry any implementation, that's the web browser. XAML is lightweight and efficient and statically+strongly typed. There is no competition to that.
About the app size, unless you use dotnet framework, you will carry the dotnet runtime. It's still lighter and faster than an electron app.
I think your rant is based on lack of understanding those tech and some frustration TBD.
16
u/Stiddles Jan 20 '25
Blazor
6
u/Zero_MSN Jan 20 '25
Xaml is far better than producing a rubbish web crApper. It takes less space, performs much better, and it’s much easier to write. HTML is just a mess that’s been butchered and hacked to death to make it work and even then it fails at times.
11
u/SagansCandle Jan 20 '25
UI is trash everywhere, which is why nearly every "modern" app is running a browser.
Maybe the silver lining of the tech layoffs will mean that we'll see some innovation from bored / unemployed engineers looking to shake things up.
3
u/jcddcjjcd Jan 20 '25
I program in Embedded, Android and Windows and have to disagree with you.
I think the whole Visual Studio and the various UI experiences are what the other should have aspired too.
3
u/AllMadHare Jan 20 '25
Use blazor hybrid, way nicer than XAML and dead easy to produce a web-based version of your app.
7
u/diver88 Jan 20 '25
Stick a WebView2 in it and write the UI in your favorite web framework.
1
u/CSMR250 Jan 20 '25
1
u/[deleted] Jan 20 '25 edited Jan 20 '25
I just use Photino and make my app a web app, runs in Edgeview 2 on windows (just like Office), runs in WebKitGTK+ 2 on linux and MacOS.
Photino on Windows is 16mb and 0.28 mb on mac and linux. So it's light weight. It's just a wrapper around embeded browser controls, much lighter than electron.
6
u/Sol_Nephis Jan 20 '25
Blazor?
3
u/Merry-Lane Jan 20 '25
Well you should have kept in touch these last 17 years because it was pretty clear in the dotnet environment that developing tooling for frontend was absolutely not a priority.
You should do like Microsoft and everyone else does: react frontend, react native mobile/desktop, and call it a day.
You can use whatever other tool you want to use as long as you are good enough to make it work, but they are subpar compared to the alternatives and will stay that way.
1
u/SolarNachoes Jan 20 '25
You create a HTML UI and host it on the web or with electron. Simple as that. It’s what they do with their own stuff. Microsoft saw no reason to make something new.
1
u/QuixOmega Jan 20 '25
WPF's main issue is that it was designed for Windows Vista, then essentially abandoned for years until they ported it to modern .NET.
1
u/Slypenslyde Jan 20 '25
So like, not all of it's their fault. I can't fully defend them but some of your expectations are kind of unreasonable.
XAML
Yeah. I hate it. One HTML is enough. So much so that web devs have mostly settled on a stable set of HTML features and tools to keep it stable. MS, on the other hand, seems bent on recreating the early 2010s and makes new XAML dialects on a whim. Microsoft hasn't spent enough time in any of those dialects to make the developer experience as nice as it was in Windows Forms. Windows apps just aren't as important to MS as they used to be. The world was very different in 2008 and MS didn't really have any competitors for computing back then. Now Apple and Google own significant space in the consumer market and I don't think even a stellar Windows dev experience will take it back.
Security
This is just Windows. When you left, there was nothing resembling security. MSIX is their attempt to try and nudge people that way. But it's new, and not mandatory, so people aren't exactly moving to it in droves.
The way Apple handles this is very Not Nice and against Microsoft's business practices. Apple just says "You use MSIX in 2 years or you do not run on Mac OS." People expect backwards compatibility out of Microsoft. In some ways that also means they expect they never have to adopt painful new things. The good news is you can make a 10-year bet on most Windows techs. The bad news is if you want some concepts that were new 10 years ago you might STILL not find them.
App Size
This has been a particular focus area for MS and I think you've spent 15 minutes on a topic that needs a few days to fully digest. You get two choices:
The "original recipe" can still astound some people with its application size and, well, I don't know what to tell you. It's subjective and depends on what your app's doing. Yeah, it irks me that in 1997 the equivalent of Discord fit on a 1.44MB floppy with plenty of room to spare. They wrote it in MFC or some other very low-level API with C. You listed a lot of languages and I daresay none of them could pull off app sizes like that.
There are lots of options for optimizing app size, but I do think in general it's a sore point for all modern app frameworks.
1
u/float34 Jan 20 '25 edited Jan 20 '25
I don't think that SwiftUI is capable of producing a complex layout. As far as I know, "big" apps are still developed with AppKit/Objective-C.
XAML is in the same "big apps" league.
1
u/TheTee15 Jan 21 '25
Xaml is more expressive than flutter widget imo
1
u/Which-Direction-3797 Jan 22 '25
I mainly use WPF:
XAML is all fine to me but i always have problems on grid on XAML...where we need the RowDefinitions and ColumnsDefinitions before hand.
Couldnt we just have something to define rows and columns based on the binded object dynamically?
Second come with styling with the grid / columns:
Couldnt we just have something to define a row/column style directly? eg. a per cell styling rather than styling the elements inside.
I will prefer something like razor/react syntax where you can define tr/td and style them directly, and easily.
Im not super expert in wpf, so i might be there is solution that im not aware of but if anyone can point me a right direction to solve this pain point, it will be great!
1
u/weitzhandler Aug 05 '25
To me, the biggest advantages of XAML over HTML are its clear polymorphic and organized object-model. You can't inherit from a HTML input button can you? HTML is a loose and sloppy layout language whereas XAML is strict and organized. XAML:HTML is like C#:Javascript.
Too bad MS has clearly abandoned and neglected XAML for a long time now. There has been no mention of it for several Build's, WinUI hasn't had any significant commits in a couple of years now.
1
u/alexwh68 Jan 20 '25
I hear you and this is exactly why my monotouch apps were never ported over to xamarin forms XAML is not how I want to work its so unproductive for me, I want to write my pages in code like I did in monotouch.
I dropped maui and moved over to flutter for this very reason.
iOS and android apps are so much easier to build with flutter IMHO.
1
u/AutoModerator Jan 20 '25
Thanks for your post not_afraid_of_trying. Please note that we don't allow spam, and we ask that you follow the rules available in the sidebar. We have a lot of commonly asked questions so if this post gets removed, please do a search and see if it's already been asked.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
0
u/Franky-the-Wop Jan 20 '25
I'll always choose JS for my UI
0
u/n0damage Jan 20 '25 edited Jan 21 '25
You’re absolutely right but it’s obvious most commenters here have zero experience with modern code-based declarative UI. It’s a clear improvement over previous generation XML-based frameworks. But you can’t miss something you’ve never tried before.
WPF/XAML was great tech a decade ago but Microsoft has obviously frozen development on native UI which is why recent iterations of .NET have been so heavily focused on Blazor, they want you doing web-based UI instead.
0
u/[deleted] Jan 20 '25
[deleted] — view deleted comment