S05E17 1h 14mSeason 5

Episode Summary
Mike James, the CEO of Avalonia, shares his insights on the world of cross-platform UI frameworks for .NET, including the strengths and challenges of the community-driven approach. He discusses how Avalonia compares to competitors, such as Uno and Maui, and the importance of quality documentation to enhance the developer experience.
With a focus on the future, James reveals exciting plans for Avalonia V11, which will enable iOS, Android, and WebAssembly, and make Avalonia the go-to framework for .NET developers. Tune in to discover how Avalonia is revolutionizing the world of UI development through community collaboration and innovation.
Episode Transcription
Hello everyone and welcome to THE .NET Core Podcast. An award-winning podcast where we reach into the core of the .NET technology stack and, with the help of the .NET community, present you with the information that you need in order to grok the many moving parts of one of the biggest cross-platform, multi-application frameworks on the planet.
I am your host, Jamie “GaProgMan” Taylor. In this episode, I talked with Mike James about Avalonia and XPF. Mike is the CEO of Avalonia, and I wanted to talk about some of the things that Avalonia and it’s XPF offering solve. This meant discussing Avalonia’s competitors (Uno, Maui, and native apps), and talking about Avalonia’s lack of good quality documentation - this has been solved in the time since we recorded this interview (March 17th, 2023).
Along the way, we talked about open source development and some of the expectations placed on open source developers by both the community and the open source developers themselves. And make sure to stick around to the very end to hear Mike drop some software engineering wisdom when he tells us precisely how the team got a cross platform UI framework running on all of the Linuxes - the way they did it might actually shock you.
So let’s sit back, open up a terminal, type in dotnet new podcast and let the show begin.
Jamie
Mike
Jamie
Mike
Jamie
Mike
Jamie
Mike
Jamie
Mike
Jamie
Whereas I feel and again, I may be getting this wrong, but this is my experience, my opinion, a lot of Javascripty stuff is very opinionated, but because they’ve all come from different directions, because everyone’s coming from different directions and indeed solving different problems, right? Like comparing Angular to React is a non starter because Angular is an entire framework, whereas react is like a pluggable architecture that you can bring in to help you with state management and all that kind of stuff. Whereas Angular is very, “you will do it this way and you can’t deviate,” and React feels a little bit more, “you want to bring this in, that’s fine. Or you want to bring in something else totally fine too.” And neither of those is necessarily wrong or right. Because they’re just two wonderful different ways of doing stuff that I wasn’t there from the beginning. And so I don’t really get how it all fits together.
Mike
Jamie
Mike
Jamie
Mike
So I’m Mike, I started cross platform development. Like my first job out of university, I was building apps with “cute” or QT. I’m never quite sure how to say it. I’ve heard some people say it’s cute, but it does feel a bit strange to say I built with cute.
Jamie
Mike
So cross platform goes all the way back to the beginning of my career, and my second job was at Xamarin and I worked there all the way through the acquisition. So that was again cross platform, but this time C#, which was a program when I was 13 in VB .NET. Please don’t judge me for that. We’ve all made terrible life choices at some point. I have repented, and I now use C#. I’ve tried F#, but I’m not clever enough. So yeah, I started building apps with Xamarin and I worked for them. And the mission there was, how can we help C# and .NET developers build applications for non-traditional Microsoft platforms? We want you to be able to take your existing code and your existing skill sets and target iOS and Android. And later on, MonoMac became commercialized with Xamarin Mac.
Even further on from that, we were acquired by Microsoft and we kind of overnight went from a company that I thought was huge at like four or 500 people to 100,000, and everything changed. Like we stopped using Google, so we had like Gmail and Dropbox, as most startups do; and we became an Outlook shop using Office 365. And again there’s pros and cons with every technology choice.
Yeah. So I worked at Microsoft for seven years and I recently joined Avalonia. So I’m sure many of your listeners know what Xamarin is, some of them possibly don’t. They’ve definitely heard of Microsoft, but they might not know what Avalonia is. So Avalonia is an open source cross platform UI toolkit. And it’s a decade old. It’s got contributors from all over the planet. I was having a look. If we look on GitHub, it says like there’s 200 and something contributors, but we’ve got some other analytics that goes goes back even further through the history because the project was renamed and it’s actually showing over a thousand contributors, which is crazy to me.
But it’s this big project that’s part of the .NET Foundation. Most months it’s the most active and popular community project within the .NET Foundation, and it enables people to build cross platform apps for non-traditional platforms using .NET. So Mac and Linux have kind of been the bread and butter. Obviously you can build for Windows, but that shouldn’t be a surprise to anyone. We’re bringing out soon. Hopefully by the time this airs, we’ll have V11 shipped, and that’s enabling iOS, Android and Webassembly. So the idea is bring your Xaml skills, bring your C# skills. If you’ve ever built an app with WPF, you are now an expert in Avalonia. You’ve not had to do anything, you just are, and you can target these new platforms.
And I joined Avalonia as the CEO just a couple of weeks ago now, but I’ve been engaged with the project for years and years. We’re trying to build a commercial side in order to help us support the people that have been grinding for a decade for free on the open source side. So we want to commercialize value adds to help us support the open source side.
Jamie
I was having a conversation with my friend Scott a few days ago about the different, I want to say expectations that open source developers have. And all of these are perfectly valid. All of these are perfectly valid. There’s some folks who are like, “I want to make a thing, to make the world better and I’ll give it away for free.” And that’s awesome. Brilliant. And then at the other end of a spectrum of open source goals, “I’ll make the thing, I’ll give it away for free and then I’ll like question marks profit.” Right? And then there’s a number of different people in that end who are very from my perspective of looking at how people have interacted on Twitter and Reddit and GitHub and stuff, there’s multiple different within that one statement, there’s multiple different spectrum points or whatever.
I have experience of dealing with people who are like, “it’s open source, but you should pay otherwise grrrrr!” And there’s other people who are like, “it’s open source and there’s a paid version if you want. I don’t mind doing it me on time, it doesn’t matter.” Right. And I feel like there is a conversation to be had, perhaps outside of this one, on setting those expectations for both the open source developers and the consumers of those open source projects.
Because I’ve felt for a while that there’s that Xkcd comic and I keep stepping over you here, Mike, I do apologize, but no, no, there’s that one XKCD comic of, you know, “here’s all the internet infrastructure and there’s this one block that’s maintained by a person in a basement in Finland.” We should be supporting those people, right. Because everything we do, we are literally standing on the shoulders of giants, right?
Mike
But there are others that they expect an awful lot. And I get it, they’re building, often times they’re betting their business or sometimes it’s a pet project, but they’re investing in our technology by using it. And so we have some obligations to them to deliver something that works. But the thing is, Avalonia, as I said, it’s been developed for a decade. And the guys that started it and are still with us all the way through, they’ve worked really hard to get it to where it is. I mean, this is used by GitHub, Schneider Electric, Jetbrains and Microsoft. There are people using it that have deep pockets and the could invest in using almost any other technology, but they’ve picked to use Avalonia. And I’ll be honest with the enterprise side of things that we’re definitely supported there. And we have our support contracts, so we’ve got agreements in place and they’ll sponsor the project as well. So we’re able to give back to the people that have helped build Avalonia.
Our goal is to be able to basically employ everyone that’s contributing. That would be our ultimate, but we don’t want to take anything away. There have been other very useful .NET libraries that have changed their licenses. I won’t name them specifically, but there was controversy around it. And actually I think that the request that was made, it was super reasonable: If your business is making over a million dollars in revenue a year, pay us a couple of it’s. And I was like, well, " yeah, the work that that developer and that team have done is years worth of work. And you’re not going to be able to rebuild that unless you’ve got a deep knowledge of a very specific niche." And I look at that license fee, and I think that’s a bargain. I would gladly pay that, number one, to support the dev number two, because if I need that, then it’s really good value.
When we were looking at how to monetize Avalonia, we’ve always been really clear, Mike, the leadership, that it remains open source. We’re not changing the license, it’s MIT, and it will remain MIT. We want to generate revenue to support the project by creating value adds. Now the first one of those is XPF, which it targets a totally different community.
So we’ve got our Avalonia community that are building apps using Avalonia, but there’s also a WPF community and there’s a Winforms community and a kind of micro community in WinUI
Both
Mike
And we get questions kind of every week, “when’s V11 going to move from preview?” I think it might come from a position that they assume that we’ve got like hundreds of developers and that we’ve got a big management structure where we set a deadline and we’re going to do everything we can to hit that. And we’re going to ship something when we’ve got our big conference, like, “we’re going to release by .NET conf”. No.
And I’m really keen with the guys when we talk about this. Is it’s ready when it’s ready. I don’t want anyone burning out. I don’t want to tell the guys, “you need to pull some all nighters and work weekends.” That’s not healthy. We’ll ship it when it’s ready. And if you need to wait another month, I’m genuinely sorry. But you know, the current version, 0.10, that’s stable, that’s in production, that’s workable. You can use that. And we’ve got people building with the preview versions, and Unity have pushed an app to production with it. So if Unity are happy to use it, then you probably all right yourself.
But yeah, I think there’s open source is difficult. I think interacting with any community can be difficult. But we are our community. We built for it as a community project. The company came into existence only three years ago because of the huge demand from companies. So we’re very cognizant that the community comes first in everything that we do. And some days the community is harder to deal with than others. But we still run every decision that we make and all of our future plans through the lens of “what’s best for the community.”
Jamie
Mike
So documentation, samples, making sure that we have all of that. Because if it’s not documented, it doesn’t exist. One of the key things for us this year and we talk about the roadmap is I want us to have the best documentation for building cross platform UI apps with .NET. One of the things that I remember when I worked at Xamarin was people used to say to me, “you have the best documentation,” and I never really appreciated it. But even Objective-C and later on, Swift developers would come and use the Xamarin docs to understand how to build their iOS apps. And yeah, the penny never dropped at the time of just how good the docs were. I hear the opposite most of the time now when I’m speaking to people about Avalonia, and that’s because it’s a community project, it’s been built over ten years and people will put in incredible PRs with no docs and the team look at it and they go, “do we reject this incredible contribution because it’s got no docs? Shall we write the docs? Yes, let’s create an issue and we’ll get round to it,” and then another PR comes in and if I had finite resources, we would solve that.
So, yeah, we, we hear a lot that the, the docs need improving and that that’s something I’m really cognizant of and we’re investing a lot, a lot in trying to solve that for V11. But, you know, we’ve got a technical writer that’s working on it at full speed, but again, it’s done when it’s done. I’m not going to release docs that’s half finished because it’s no use to anyone. So bear with us. And this is all on the community side as well. We’re sponsoring this work from the revenue, the modest revenue that’s generated from the business.
But I’d rather be spending that revenue on employing the people that are contributing to the project so that they can work on it full time, rather than having to pay a technical writer a lot of money to come in and rework our entire docs. Because the community are quite happy to complain about it, but then they’re not happy to contribute to fixing it.
I will finish on this one moan about this because it’s still quite raw for me. It was on Reddit, so you know a place where you can have challenging discussions with people and somebody described our docs as being absolutely horrible and I kind of shot to the heart, it was like, “okay, yeah, I know our docs need improving and we are improving them.” And somebody said that it was useful feedback and it’s like but it isn’t. To tell me that our documentation is absolutely horrible. I can’t action anything with that. Like, you said that you struggled with something. Tell me, what did you struggle with? Where did you hit a dead end and need to go and dig into source code? Or where were you, like, digging through our old GitHub issues or through the Telegram chat? Tell me where you struggled, create an issue for it and we will get the docs written. But if we don’t know what we’re missing, therefore where you’re struggling, it’s really difficult. So saying that the doctor absolutely horrible, it upset me a little bit, but yes, I feel like I’m just on a tangent at this point.
Jamie
Mike
Jamie
Mike
But, yeah, we need the feedback in order to do that. So telling me it sucks, zero points in terms of helpfulness. Opening a GitHub issue to tell me where you got stuck, that’s like a solid six out of ten on helpfulness sending in a PR with the actual, “this is where I got stuck and this is how I fixed it,” it doesn’t need to be perfect. We’ll make it fit the style, we’ll rewrite it so that it’s perfect. We’ll fix the grammatical errors, but contribute something, get involved with the project. Thousands of other people have been doing it. It’s a community project.
Jamie
Mike
And I think it’s probably easier for… so we don’t have any telemetry in our tooling. And this was something that Microsoft is quite big on. Microsoft fully aware of what issues you’re hitting and when you’re hitting them, and how often you’re creating different types of projects and how often you’re working on, you know, there’s monthly numbers on how many active WPF developers there are for any technology. And if you look at Visual Studio code, think about all the telemetry that’s collected in there. The can tell you how many flutter developers there are on a given week. Telemetry data is king, isn’t it, in terms of understanding usage? We’re an open source project, we don’t collect any of that. And we’ve considered it. So we’ve got our Visual Studio extension and there’s a guy from Jetbrains that builds the Rider extension and we’ve considered, “well, should we put telemetry in there so that we can capture number one usage and also where people are getting stuck, “and every single time we come back to, “probably not.” We would love to have that data, but do we really need it?
Personally, for me, I don’t feel thrilled when I’m giving up that kind of data. So we err on the side of, “let’s do without.” But there’s definitely an argument there for if in a couple of years time we’re in the same position where we still don’t know what people are doing. We may need to investigate adding some form of telemetry, but it’s not something I want to do. So send in your issues, your pull requests, communicate with us, jump into our chat and tell us where you’re having issues and yeah, just talk to us, it’s the most helpful thing.
Jamie
I feel like with a number of projects now these could be programming projects, these could be frameworks, these can be IDEs and tools, it could even be websites, right? I know people who will leap directly to the most complicated possible way to do it, with the most amount of logging and telemetry and analytics and all that kind of stuff. And then they’re like, “we’ve got no users.” Of course you don’t, because you’ve just spent six years building telemetry and logging and analytics and the most complex thing ever. Whereas I threw together a HTML page today that has a sign up form and I’ve got 15 people signing up, right? That’s 15 people who are genuinely - these are all examples, right?
But there’s a difference between jumping right towards that telemetry and all that kind of stuff, or going the grass, I suppose. grassroots I don’t know if it’s the right term to use, but the grassroots way of saying come to… “you tell me.” Because I can’t see because there’s also in one of the niches that I exist in, podcasting last year and the year before, there was a version of Audacity that got released with loads of logging and people just got really upset and, “we’re not going to use Audacity anymore” right? And you mentioned VS Code. There is a project called VS Codium, which is VS Code without all of the telemetry, but it also means you don’t have some of the debugging features as well, because some things are closed source within VV code. And I have this feeling that if you become big like Avalonia, like Xamarin and all these kinds of teams, you release something massive that’s doing really well. Then you add telemetry, you might get a core portion of your audience, your users go, “I’m not touching that any more because I don’t know what it’s doing on my computer.” For real, legitimate concerns.
Mike
A Request To You All
If you’re enjoying this show, would you mind sharing it with a colleague? Check your podcatcher for a link to show notes, which has an embedded player within it and a transcription and all that stuff, and share that link with them. I’d really appreciate it if you could indeed share the show.
But if you’d like other ways to support it, you could:
- Leave a rating or review on your podcatcher of choice
- Head over to dotnetcore.show/review for ways to do that
- Consider buying the show a coffee
- The BuyMeACoffee link is available on each episode’s show notes page
- This is a one-off financial support option
- Become a patron
- This is a monthly subscription-based financial support option
- And a link to that is included on each episode’s show notes page as well
I would love it if you would share the show with a friend or colleague or leave a rating or review. The other options are completely up to you, and are not required at all to continue enjoying the show.
Anyway, let’s get back to it.
Jamie
Mike
Jamie
So you mentioned earlier on that one of the things that you’re hoping to have released by the time that this episode drops. For context folks, we’re recording this on the 17th of March and I’m planning to release it on June 9th. So there’s a bit of time. So everything that Mike has already said and will say has the caveat of we’re talking in the past to you in the future. Right. Anything can change between when we’re recording and when you’re listening. So anything can and will change and I’m not going to hold you to anything, Mike. If you want to say that the sky is green, I’m like cool, that’s cool with me. The sky is green, let’s go with this.
Mike
But yeah, in terms of cross platform UI, hopefully by the time this goes out, V11 will hit stable. We’ve got preview 6ix coming, as you say, on 17th, we were thinking it would be this week. It’s probably going to be over the weekend. We think we’ve locked down master and we’re just running tests at the moment. Preview Six has got some changes to the dispatcher. We weren’t expecting a preview six, to be perfectly frank with you. We thought, “we’d do preview five, we’d do a release candidate and then we’d be happy days, it’s done.” But we thought there’s a couple of things that we want to put in here and make some breaking changes. And this is really important because API stability is like, it’s something we prioritize massively. So with each major version of Avalonia, we want to use that major version as an opportunity to make breaking changes. And the once you’re into your point releases, then we’re not going to make anything radically different. So if we don’t kind of do the tidying up that we want to do with V11, then we’re going to have to wait like two years until V12.
So as we find things that we’re like, “okay, this probably needs to go in.” It’s like, “okay, well let’s create another preview.” And who knows, maybe by June 9 we’ve got like preview 30 or something and I’ll have gone totally gray. But as I said before, it’s done when it’s done.
Jamie
Could you speak to how? Because again, I’m speaking of you again, but also for people who’ve just heard that and gone, “holy moly guacamole, I need to go and get XPF because Jamie said,” could you set their expectations? Because I’ve obviously just blown a hole in everything.
Mike
Let me give some context. So you’re quite right. It allows us to take WPF apps and run them basically on top of Avalonia. How and why did we do this? Because we’ve got our UI framework. So the why is that we created this company three years ago in response to the demand from enterprises for support and also for projects. And the projects make up two thirds of the revenue for the business. And some of the projects are like multi year. One of the big projects is a two year process and the billing is extremely large. But we don’t want to grow old porting WPF apps to Avalonia. It is something we will do and we are more than happy to do it. If you have a WPF app and you want it ported to Avalonia, get in touch, we’ll give you a quote. We just don’t want to do it forever.
And part of the problem with that is that, as I say, it can be a multi year process. It’s expensive to basically halt development of your application, to migrate it to any new technology. It takes time and you’ve got the opportunity cost as well. So not just the cost in either outsourcing or having your debts do it. Your competitor is going to be six months, a year, two years further ahead, and all you’ve done is reinvent the wheel. You’re stood in the same place, but in a slightly different outfit. WPF developers. I mean, WPF was released in what, November 2006? So it’s 16 years old. It could buy a lottery ticket, it could get married with permission from its parents, Microsoft, at least in the UK.
It’s an old technology in the scheme of things. And there are companies that have built applications using WPF, and these are mission critical applications. The businesses live and die by these applications existing, and they need a modernization strategy. And the one that’s coming out of Redmond is “rewrite the app.” It’s like, that’s high risk. It’s expensive, and it’s going to take a long time. And depending on which technology you pick to rewrite to, it can be really high risk.
And sometimes it’s just not even suitable. Like, one of the suggestions it was at .NET Conf was, “modernize your WPF app to Blazor.” It’s like, Well, Blazer is a web technology. It’s not in any way suitable for some of the apps that a lot of the apps that we see are medical devices or embedded devices for measuring particles. And putting that as a web app possibly could be done, but is it the right choice? All of your team are XAML developers and you’re saying, “okay, now you need to go and learn this Razor syntax and this web tech.” And I don’t think it’s a viable solution. And given the amount of interest we’ve had importing, we didn’t think it was a viable solution. So, yeah, we’re porting all of these apps, loads of customers, more demand for porting than we can realistically service, and we don’t want to grow our porting WPF apps. So we were looking at, “well, how can we fix this?”
Avalonia UI is like, the spiritual successes to WPF. It’s really similar. But there are some differences. We haven’t just blindly copied the WPF APIs because then you would end up with all of the limitations. And not every decision that the Avalon team made back in the day kind of passed the mustard. Is it passed the mustard? I think that’s the correct phrase.
Jamie
Mike
Yeah. So the project has never been about blindly copying WPF, but it’s similar enough that most companies, if they’ve got a well architected MVVM application, we can do a port pretty quickly. We’re doing a port at the moment for a big financial institution. They’ve used MVVM. They’ve got some nice DI. So it’s basically just a case of updating XAML files and changing the styles. So it’s not difficult, but it’s tedious. Depending on how many views you have, it becomes very time consuming.
So we decided, “let’s build a compatibility layer.” And when we were discussing how we do this, we were thinking two options. We either do what we’ve done with XPF, which is fork WPF, or we build some kind of migration tool where you could migrate your app to Avalonia and it would just, like, convert your APIs. I was quickly told why the migration tool was a terrible idea. And that’s because the third party dependencies, you don’t have the source code for if you’re using Telerik or Infogistics or ActiPro, you don’t necessarily have the source code for that. So just a migration tool isn’t going to bring your entire app across. So we decided, let’s go with the forking of WPF and make it run cross platform.
So Microsoft made WPF open source. It was very generous of them, but they kind of I like to describe it. It’s a phrase that Nat Friedman from Xamarin used to use of, “just throwing something over the fence. It’s like, you forget about it, you just lob it over and it’s done.” So they open sourced WPF and then kind of forgot about it. They weren’t accepting contributions. And there were lots of questions about, “can this be cross platform?” And just to get it to build on a Windows machine was arduous. So we decided, well, thank you very much, Microsoft. We’re going to take that and we’re going to fork it, and we’re going to replace all of the low level implementation with Avalonia. So we’re going to leave the presentation framework and presentation Core largely untouched. We’ve had to make a couple of changes, but it’s a really big point for the team of, “don’t change the code in those libraries. “It remains the same.
And what we’re doing is we’re replacing MIL Core at the lower levels with Avalonia. And so this means that you can take your WPF app and you can run it on macOS, and Linux; and Webassembly, and iOS, and Android will be coming next year. But you can do that by only changing the csproj.
So yeah, you open up the csproj, You change the project SDK. You need to remove the
UseWPF because you’re not using that any more. So it’s Project SDK, UseWPF. and you hit F5 and you’re now running on XPF. And you can take those binaries and you can do it on a Mac, you can do it on Linux. Nikita, who is like one of our many resident geniuses, or geniai? he’s incredibly bright. He develops on Linux. And he saw that
Paul Thurrott had liked one of our tweets, so he jumped onto
Paul Thurrott’s GitHub, found an application that he had written, he cloned it to his machine, opened it up in JetBrain’s Rider, updated the Project SDK. That app had a dependency on Winforms, so he had to add an additional attribute, which is <UseXPFWinformShims>True</UseXPFWinformShims>. With that, he hit F5 and he was now running this WPF app. And it was literally like 30 seconds to do that migration.Jamie
Mike
So I mentioned the Winform Shims. We’ve got Win32 shims as well. And these are really needed for those Telerik and DevExpress controls where they’re oftentimes it’s a Winforms control masquerading as WPF. And so we can support that, and we do support it. We’ve got customers that have got entire apps that are just full of Telerik and DevExpress and ActivPro and all the various control vendors. And we do that by at the moment, my guys take the application, they attach the debugger and they run it on XPF. And they’re looking for where are these controls reaching down into GDI and Win32 APIs. And then we’re providing those shims to make them work cross platform.
So that’s why we’ve not given out XPF as a demo for everyone to run. Because if you just took it and your app in any way was calling into an API that we hadn’t created a shim for yet, then it would crash and that would be a horrible experience for you. And you go, “this doesn’t work”" In your case, it wouldn’t work.
But if you are using Pure WPF, then it is magic and it just works. If you’re not, then our guys will make sure that those APIs are available. And we think within six months or a year, touch wood, we’ll have all of the shims in place required to run like 90, 95% of all applications cross platform without needing to speak to us. So we’re building an analyser tool that is based on the old mono analyzer, so it’s called MoMA. It’s a tool that Joseph Hill, one of the co-founders of Xamarin, he created [that], he describes it as his baby. We’ve taken that, we forked it, we’ve updated the definitions to use XPF definition. So you bring in your WPF app and it can tell you, “these are the problems that you’re going to have.” And then from that, if it’s like 100%, like, this is great, you’ve got no worries. You’re not using any Win 32 APIs, you’re not using any Win forms APIs that we haven’t already provided in our shims. Then click here to buy a license and you’re off to the races. We need to do some work on our end. It’s a case of get in touch and we’ll work with you to make sure that your app works.
Jamie
Mike
Jamie
Mike
Jamie
Mike
Jamie
Mike
Jamie
Mike
Okay there are three players in this. In terms of cross platform, if you just want to go for Windows, then you’ve obviously got Winforms, WPF, UWP, WinUI. Take your choice. If you want cross platform, you can go with actually, there’s kind of four. You’ve got Maui, you’ve got Uno, you’ve got what was we used to call traditional Xamarin, which is just the bindings to iOS and Android. I don’t think I could in good faith recommend those approaches, especially for iOS, given Apple moving most of their SDKs to Swift. And whilst they do have a Swift binding story, there are many, many APIs that aren’t available there now. So I would kind of discount the traditional Xamarin approach. So, yeah, you have Uno, Maui and Avalonia.
People often ask me if I think that Uno is a competitor. I don’t, simply because I’ve seen the usage numbers for UWP and WinUI. It’s tiny, so I don’t lose any sleep over what they’re doing. And I think that reimplementing - I’ve been very vocal about this - I think reimplementing a Windows API to Mac, Linux and Web and all of the platforms and being bound by what occurs in Redmond doesn’t particularly make sense as a strategy. I wish them good luck, but for me, it’s not something that I worry about.
I think Maui obviously being the continuation of Xamarin forms super strong on mobile. So I think right now if you’re building a mobile app, you should probably just cut straight to Maui. That being able to use native controls in a mobile app is really important because a lot of the best mobile apps that you’ll use are using native UI controls. On desktop the story is quite different. It’s really rare to use a native desktop app. I mean, we’re chatting here in Discord. This is absolutely a web app masquerading as a desktop app. Teams the same thing. Visual Studio Code, Figma, Skype, Slack. I struggle to think of apps that I use on a regular basis that are actually not just a website. So we’re competing against those technologies on the desktop. And when you deliver a native app, it’s so much more performant, it’s using so much less memory, it’s quicker to start. There’s a whole host of benefits. So I think that Avalonia is really, really strong in the desktop space and we do really well in embedded. Webassembly is definitely going to be interesting. But Maui doesn’t support Webassembly. They can’t support embedded because they don’t support Linux.
So I think, as I said right at the beginning, it’s horses for courses. There’s no right or wrong answer for me. I’ve worked at Xamarin, I love that technology. I think that Maui has a lot of potential. I think that on the desktop side, to be frank, I think they’ve made some decisions that are going to haunt them for a very long time. I think that picking WinUI was a terrible decision. And an even worse decision was to pick Mac Catalyst. Even Apple can’t make decent catalyst apps. I don’t know how you could possibly create one using an abstraction even higher. So yeah, I think that we’re in a really unique position because of how we work, because we use Skia to render everything, we have full control of how your app looks. So it’s much more like Flutter.
When we think about competition on mobile, we’re looking at Flutter. That’s our competition. We’re not worried about what Maui is doing because we think, and I’ve certainly seen this a lot of companies now, they’re going, “well, Maui isn’t ready and it’s quite a sad state of affairs. If we need a mobile app, let’s just build it with Flutter.” And so the question that we’re thinking about as a team is, “how do we make it so that they don’t go to Flutter and that they come to us instead?” So I’ve got a guy that’s working on Android basically full time to improve our Android story, and we’ve just hired a guy that’s going to be working on the iOS side of things. So mobile is one of our key investments. And the on the embedded side, we looked cute or QT because they’re the market leaders. So I think that Avalonia is in a really strong position to kind of take over all of .NET. I think because of our heritage as well, being community focused. It’s a community project. It wasn’t started by some giant corporation or profit seeking entity. We were built by the people, for the people.
Jamie
Mike
With Maui, we are very keen to have a partnership with them because as I said on the mobile space, if you want to compete within the consumer, and I used to say this at Xamarin as well, if you want to build a consumer application for mobile, you really do need to be using native controls. And I think, to be honest, you probably need to be building it for iOS and Swift and then on Android using Java. Or I’ll admit, Android for me is something I basically ignore 99% of my time. But I think that, yeah, to deliver that kind of five star experience right now, you probably just want to be using Swift. And when Xamarin was created, the only option you had was objective-C and that was a horrific language to develop in. So like C# was a breath of fresh air, it was lovely. But Swift is also really nice to use. So I think if you want native controls then just build it with Swift. I wouldn’t bother with anything else. If you don’t need native controls, well, then there’s a whole host of options available to you. You might want to look at Flutter right now because it’s pulling away from where we are in the .NET world and that’s why we look to Flutter as a competition and we want to be much closer to their functionality.
But coming back to my point, we wanted to partner with the Maui team and we created a hybrid approach that enables you to embed Avalonia into a Maui app so you can kind of mix and match. You can have some native controls with Avalonia controls in there as well. And we’ve also considered creating a back end for Maui based on Avalonia. So just like their back ends run on Mac Catalyst and WinUI and Coca Touch and Android Widgets, we could do it that sits on top of Avalonia, and that would enable your Maui app to run on Linux, and it would enable your Maui app to run on Webassembly as well.
To be frank, we don’t know if we want to pursue that because we’re a small team, we have finite resources and do we want to kind of be working and maintaining that code for a project that’s maintained by a multibillion corporation? I mean, Microsoft’s got a market cap of $2 trillion. I kind of feel if they, if they really wanted Linux and webassembly support based on Avalonia, I’d be happy to talk to them about sponsorship of that work and we could come to some arrangement, but I’m not sure; we’ve got the proof of concept. It works, but I’m not sure I want to flesh that out and kind of go to production with it. Sure, we’ll see.
Jamie
Mike
So our technical writer has very limited experience with Avalonia. And you would think like, that’s an odd choice. Why would you hire a technical writer that doesn’t know your framework? But it’s actually proven to be incredibly beneficial because he is asking all of the questions that you would probably ask. He comes from an MVC background, so he knows HTML, he knows some JavaScript, he knows CSS, but he’s more about ASP .NET development. So his way of modelling and thinking about application development mirrors much closer to yours than it does mine. And so he’s asked some absolutely fantastic questions. And the way that he’s writing the docs, it does go back to the basics of, “what is XAML?” And we need that because there are people that need to understand. You don’t have to use Xaml to write Avalonia. You can use just POCOs, so plain old clr objects. You write it in C# or VB .NET or S sharp. If that’s your thing, it doesn’t matter. I mean, you could even do it in Cobalt because there’s a .NET version of that. It doesn’t matter as long as it’s .NET language.
So, yeah, my advice would be read the docs if that’s how you like to learn. If you don’t like to learn reading docs, there’s a plethora of YouTube content available to you that will teach you Avalonia. If you get stuck and you’re wondering, well, or you finish watching every Avalonia video on YouTube, start learning about UWP or WPF or just the standard approach, you know MVVM and XAML. I think if you know HTML, you basically know XMAL. It’s a markup language. If you know how to write XML, you know XAML. It’s not a terribly difficult thing. It’s about building that mental model. And that’s what our new docs, which are, my goodness, I hope I can say, they’re already out in the future. Now, in the past. We have tentatively said that we will publish next week, but I need to double check with the team. But yeah, they are focused on taking you from an absolute beginner with no experience through to building an app on your preferred platform for your preferred platforms. On top of that, we’ve got the samples so you can clone those, whack the breakpoints in, explore how it works, fiddle with things, break it. And when you get stuck, come to our community, chat with them. You might ask a question that generates a new sample.
Jamie
Mike
Jamie
Mike
Jamie
Mike
Jamie
Mike
Jamie
Mike
Jamie
NuGet install, npm install, ruby install, or whatever it is, right?Mike
Jamie
Mike
Jamie
Wrapping Up
That was my interview with Mike James. Be sure to check out the show notes for a bunch of links to some of the stuff that we covered, and full transcription of the interview. The show notes, as always, can be found at dotnetcore.show, and there will be a link directly to them in your podcatcher.
And don’t forget to spread the word, leave a rating or review on your podcatcher of choice - head over to dotnetcore.show/review for ways to do that - reach out via our contact page, and to come back next time for more .NET goodness.
I will see you again real soon. See you later folks.
Useful Links
- https://www.avaloniaui.net
- https://avaloniaui.net/XPF
- https://t.me/Avalonia
- Mike on Twitter
- MonoMac
- AvaloniaUI on GitHub
- XKCD: Dependencies
- XPF
- Flight of the Concords - Hiphopopotamus vs. Rhymenoceros
- Obsidian
- VS Codium
- MVVM
- WPF on GitHub
- Mike showing .NETPad using XPF
- Paul Thurrott’s GitHub
- MoMA
- Olia Gavrysh from Microsoft
- Laurent Kempé requesting a demo of Family Show using XPF.
- Family Show on GitHub
- Mac Catalyst
- Skia
- Flutter