My #MAUI Day talk - part 1
This is a summary of part 1 of the talk I gave at #MAUIDay last week.
XAML is the default option for defining UIs in MAUI (and WinUI, WPF, & UWP) yet everyone seems to agree that XAML is far from great. It can be verbose, hard to read, hard to understand, and hard to maintain.
Lots of people complain about it, but no one does anything about it.*
If it's so bad as to be worth repeatedly complaining about:
Surely I can't be the only one who sees the issues and has thought about doing things differently?
If that's the case, it's a very scary thought.
XAML has been used by hundreds of thousands of people since it came out in 2006 (for building WPF apps) and little has changed since then:
Are there other languages that are actively encouraged to be used and have seen so little development in almost 20 years?
Imagine trying to use a 19-year-old book on C# today!
It's not just that there are no new versions, it's that the way we think about it hasn't changed. When every other aspect of technology is evolving and being updated at a great pace, why has something that we all know to be bad not been given any consideration to how it could even be used in better ways?
How do people justify choosing to use this technology today?
If an employee or co-worker told me, "We're going to use X technology, we know it's not great, and we make fun of how bad it is, but we're going to use it anyway." it would raise some serious red flags:
Developers are supposed to be smart people. Does this seem smart?
*Some people (probably between 6 and 12% of MAUI developers) have decided to abandon XAML and use C# instead.
The argument goes something along the lines of "XAML is bad, but I like C#; why don't I [or we] just use C# for everything."
It's a reasonable argument and certainly possible, but I don't think it's the silver bullet that some claim:
I'm not going to stop anyone from using C# for their UIs. In fact, I use it for some things myself. When there is logic required in determining what the UI should look like or be comprised of, using C# can be much more productive and performant than trying to do everything in XAML.
There was never meant to be a decision between using XAML or C#. It has always been the case that you get the best results when you use both. XAML and C# work together.
Of course, if the tools and languages you're using to create your app UIs are as good as you need and can imagine, and you're super productive, and couldn't possibly get any better, keep doing what you're doing.
I've yet to meet anyone where this is the case, and there was no one at the conference who admitted to this situation either.
I was worried I was "bringing sand to the beach" to present these ideas to a room full of experts and highly experienced individuals who work with XAML on a regular basis.
Sadly, I'm still to find others who are not writing the same bad XAML as everyone else.
Now enjoy Part 2, where I show that many of the issues people have with using (writing, reading, understanding, and modifying) XAML are actually down to how they use it and because they don't treat it like code.
Founder at Jugti Tech
4 天前Even if we neglect the other benefits of c# ui the time and effort saved in not learning XAML is a good reason to only use c# for UI