Choices in Desktop Development

In Software Development


Choices in Desktop Development - read the full article about software development 2021, Software Development and from Microsoft Visual Studio on Qualified.One
alt
Microsoft Visual Studio ,
Youtube Blogger
alt

>> Theres a lot of ways to build desktop apps, and on todays Visual Studio Toolbox, Sam Basu will share his thoughts and help make sense of all of the options. [MUSIC] >> Hi and welcome to Visual Studio Toolbox, Im your host, Robert Green, filling in for Leslie this week, and I am very excited to have as my guest today, Mr. Sam Basu. Hey, Sam.

>> Hello, sir.

>> Sam is a Developer Advocate at Progress and also is half of the answer to a trivia question which is who are the only two people who never worked at Microsoft to host a Visual Studio Toolbox episode.

>> Thats very true.

>> Its Mr. Sam Basu and Ed [inaudible] >> I loved the Channel 9 Studios.

I loved being there and were missing out, but hopefully someday.

>> Yeah, someday.

>> Until then, were at least online, we get to hang out.

>> Exactly. Today, were going to talk about desktop development.

Now, weve heard for years and years and years that the desktop is going away, but somehow, it never does go away, its still here, and theres a lot of options.

In only 15-20 minutes, were going to review the choices and the options and youre going to give us your take on it.

I know there was a .NET focus on Windows about a week or so ago.

How about maybe you could give us just your high level overview of whats going on in desktop development and what are all the options and what should people do when you think about doing? >> Sure. I think its a fun time actually.

Lets bring up my desktop so we could talk through some of the options here.

First off, were talking about hitting the desktop as a .NET developer.

There are other ways and the things you can do.

But to me, right now, this is a lot of flexibility, but I also understand why it brings it a little bit of confusion because, we developers, love a lot of choices until we have too much choice and then were little crippled and we second-guess ourselves.

The good news is everything you know and love, its going to stay the same, and then you can learn new things as you target newer things, like you said, like desktop power so many enterprise workflows, its not going to go over anywhere, were just making the story better.

Lets wrap on Windows.

How can you build Windows Desktop Apps? Theres lot, the traditional ones, those are still there and running strong.

Windows Forms, thats probably about 17 years old now going strong, very, very productive.

WPF, probably about 15, and again, super-rich XAML, C# based code base that you have, an ecosystem and the tooling.

Both of those things are so strong and they dont need to be like the old school, 10-year-olds WPF or WinForm sub.

They could look more than fresh and they run on .NET Framework full which is where they have always done.

But you can run them on .NET Core, you can run them on .NET 5, and moving forward .NET 6.

There are some .NET upgraded systems that are in the works so you can bring your older applications to the modern world and utilize all of the APIs and all of the beautiful new UI that you have.

All of that is here to stay.

Universal Windows platform, that is to know the way for you to build desktop app, and thats not again going anywhere, but this reaches to HoloLens and Surface Hub and all of the other Windows devices.

Then if all of it is confusing, I can see that because, again, the same term has been interchangeably used.

We also have Windows UI, which is very exciting.

WinUI 2 was a different thing.

It was a UI stack just for UWP, but WinUI 3, which is actually at the time of we are speaking here.

Its still in preview, its meant to come out by the end of March in 2021, and then flourish and go GA after that.

That is a whole UI stack that actually promises to run on both Win 32, so .NET Runtimes and .NET 5 and 6, but also UWP, which is .NET Native.

You got the best of both worlds.

You can bring in C#, you can bring in C++.

Thats all the Windows and XAML [inaudible].

>> You can also bring in the Uno platform and go cross platform? >> You could, if you wanted to take the Windows XAML, if you are really tied to it, then yeah, Uno platform is your choice.

but lets hold onto the cross-platform story because I think that is getting a lot more loved this year, in particular with MAUI.

But just were going to wrap up some of the other choices you have because, again, as a developer working on an enterprise, youre likely not just building one thing.

I always say take a look around as to what else are you building, where can you share code, what else is your team comfortable doing.

So if youre into web stuff, you should be looking at web stuff.

You can build progressive web apps, which are essentially web applications, and that you can install them on a desktop.

You dont quite all of the features.

Youre still within the browser Sandbox, but it is a start.

Then Electron is also a very good option and its been battle-tested, its been around for a while.

If you look at some of the major applications like Teams, and VS Code, and Slack, and Figma, all of those are essentially web apps running beautifully on desktop.

Thats through Electron.

It gives you that shell and it gives you some deep OS integration.

Now, if you did not need all of that, what you can get away with and what Electron makes you do is bundle in Node.js and the runtime and Chromium, the browser engine so your app always has the confidence knowing exactly what its running on.

If you didnt need that, maybe you can get away without doing it.

Thats where some of the other newer options are coming in.

If you still wanted to do Xamarin or XAML essentially but you are not so tied to the Windows XAML, then Xamarin Forms has always been an option.

You could reach UWP with Xamarin Forms, you could reach WPF apps with Xamarin Forms because essentially, youre rendering native UI from a Xamarin Forms UI Stack.

But the two nearest things that Im actually personally most excited about are whats called Blazor on desktop or .NET MAUI.

To your point, Robert, Blazor gets a lot of love, and again, you can build web applications that are now running on desktop but not through the Electron Shell.

We are using the most modern web views in every platform.

Thats web view 2 on Windows and then WK web browser on Mac.

Youre essentially spinning up a Blazor application just like if we run on the web, except now its within a Window Shell.

Then .NET MAUI, that is cross-platform stories.

Uno platform is great for what it does but if you want to have all the confidence of .NET backing you to go confidently to Windows and Mac and iOS and Android, then .NET MAUI is the story, which is, again, still very early days.

We are at preview one right now.

In November 2021, you will have that fully baked in.

Essentially, it goes to Windows through WinUI, so you are absolutely native on Windows, so I think its just a lot of choice.

>> You say its true that theres still basically two ways you can approach the desktop.

One is youre doing WinForms or some variant of XAML, whether its WPF, or its UWP, or its WinUI, or in Xamarin Forms.

Its four different types of XAML.

But XAML is XAML, if you know one, you can print the other.

>> Exactly. Well said.

>> Everything you need to know to do WPF, or UWP, WinUI or Xamarin forms.

If you are only on WinForms, you got to learn XAML, you got to learn something sometime, or you come at it from the standpoint of you do well and now youve got Progressive Web Apps, Electron as Node.js or Blazor, primarily aimed at web folks.

Is that a true statement? >> It it absolutely true.

Essentially, pick your poison.

Do you want to web stuff or do you want to do.NET and XAML stuff? Either way, youre going to be fine.

Thats a good happy story.

>> Me, Ive been traditionally a desktop developer.

Of course, Ive dabbled in web stuff, mostly for demos, but I dont really know the web stuff all that well.

I know the desktop stuff and Ive done every desktops when forms was invented because Im that old.

But I can build awesome applications, I can build cross-platform applications, I can do pretty much anything I want to do, building on the same skill set that I have had all along.

Then similarly, for a web developer, theres all new things you can do including Blazor that leverage the skill set youve always had so you dont have to, as a desktop developer, learn a web stuff to me current.

If youre a [inaudible] that desktops stuff to be current. Its still true.

>> Yeah, very much. Its not just Blazor.

Maybe you are coming from a completely different JavaScript background, angular view react, all of the spot traditions, theyre all welcome.

They will run just fine.

Again, so far, what we have talked to is just the Windows, which is majority of desktop apps, at least from our .NET ecosystem.

But if you want to bring up my screen one more time, there are others.

You can actually very easily reach macOS now and Linux for the hardcore folks who were under the desktop.

This is all .NET as well and this is all web as well.

If you want to do web, Electron is welcome.

If you want to do XAML and C#, then Xamarin.Mac has always been there.

You also have some macOS renderers that sit on top of Xamarin.Forms, which is simply what plays a Mobile Bindings is doing right now.

But eventually, they will sit on top of .NET MAUI.

One other thing that they are talking about opening up is .NET MAUI but through Mac catalyst, which is essentially Apples way of running iPad apps on the desktop.

Because Apple has a similar problem.

They dont have a lot of folks wanting to build for their Mac desktop so theyre wanting to get iOS apps to run on desktops.

Probably another way for .NET MAUI to help out.

Again, if youre running on Linux, then you do have renderers again.

I think as a .NET developer, this gives me a little bit of joy that my codes just goes to so many places, and like you said, you pick whether you want to do web stuff or you want to do .NET.

>> Yeah. Its interesting that we still make the distinction between desktop and web and mobile when if you think about it, its just apps.

Theyre apps, they have a UI, and they talked to some data somewhere, and theres code that links the two up, and then you have various screen factors, whether its your surface machine or your Mac, or your phone, or your other phone, or someone elses phone, or your iPad.

Ive got Windows, and iPhone, and iPod, an iPad, and an Android.

Ive got those all in the house and I want the apps to run on everything because if Im sitting here on my phone, I want to be able to call it the app.

Right now, this is an Android phone but I am thinking of switching over to an iPhone as my primary phone.

But its still my phone, its still a computer, it should still run apps.

>> Absolutely right. Most of what youre saying, we can do right now, I mean apps are apps.

You can put things in a shell that you can run it on desktop.

You can put things in WebAssembly, run it on a browser.

I think where do you see some of the edge cases is what exactly is your app doing.

If you are really into somewhat touch features, you might want to choose something thats a modern platform that runs as touch on touch friendly devices or as mouse and keyboard on desktop.

Or do you need a very fast rendering engine for a modern browser, you might want to get a new web view.

But if you think Robert about some of the really intense desktop applications, like graphics applications, those are actually little intensive on your CPU and GPU.

Theyre very busy in terms of the UI.

Some of that is still a little hard to do on the web.

Its not undoable, but its just takes a lot more work.

So I think desktop is here to stay.

Enterprise line of business apps will always power workflows and through desktop.

>> Totally, definitely here to stay.

But the more you can, let me expand the types of apps I build without having to throw out stuff I already know or learn something.

Now, of course, Im always interested in learning something new, but I got a lot of years and a lot of us have a lot of years and experience and knowledge in building desktop apps.

I dont want to start from scratch and become a rookie web developer when Im experienced.

I wont call myself an expert, but an experienced and the stuff I already know.

>> That is the good news. Your expertise, your investment, your knowledge doesnt go away.

You need to be open to a little bit of evolving of your knowledge to targets and new frameworks.

But like you said, like if you do XAML, like as a developer, like I get the annoyances that XAML dialects are different, but like how difficult is this, its just pure XAML and maybe some namespace there different, maybe some things that called differently.

But a XAML codebase is a XAML codebase with C#.

So Im glad.

>> I think about all the people that learn C#.

I was a VB guy and then I learned C#.

I learned C#, I can XAML, I can learn a different XAML dialect.

You learn an entirely new programming language.

Then learning XAML, which particularly if you know HTML or played around with HTML because theyre both MLs, theyre both markup language because they both essentially do the same thing.

Then you know if one variant of XAML, you can pretty easily move over to the next one.

>> Exactly. Again, if you have your fundamentals in place, like if you, a lot of like XAML and C# based code bases, you use like MVVM design pattern, which is design patterns but nothing to do with the specific framework.

Youd known one and youre good to go.

You can switch it on with other things.

You can have the sanity that you want in your code bases.

>> Obviously, some of these are getting more than others.

I dont want to put this.

Lets switch. Some of these things are new, like blazer, for example, give us an overview of its evolution in the past year or so and where you see it going and what types of scenarios its going to be optimized for.

>> Blazor understandably is very exciting if youre a.NET developer doing any type of web stuff.

Blazor is super exciting because you are either server-side, laser enabling line-of-business applications over a signal, or a bridge, or your true client side with WebAssembly running everything in the browser.

So its obviously exciting and the Blazor ecosystem is pretty rich.

You have folks like us building Telerik UI for Blazor.

There is a lot of help with UI and tools and ecosystem. Its very rich.

We can bring all of that knowledge and all of the folks who do web stuff into other things.

Because we talked about desktop today.

Its not just desktop or we can also run Blazor apps on mobile as well.

I see this as an exciting opportunity.

Like folks on the Blazor team and.NET teams are obviously excited about this because it enables all of that Blazor code, this C# and Razor syntax to now just suddenly run very nicely, very smoothly on desktop and mobile and we can also mix and match.

You can now also render native stuff with some web stuff.

It doesnt need to be completely a hybrid app that is just running web, you can mix and match.

>> Where do you see it a year from now? >> I would say a year from now, Blazor is going strong on the web, but the desktop model has been a lot more flushed out and were able to go past some of the wrinkles.

Performance is solid and the thing we dont always talk about, some of the pinpoints are on the edges.

If you are running a Blazor app on desktop, where is your child script bridge or your interrupt? Because what if you brought in something where you have some JavaScript, maybe its a web app that youre bringing it in and you want to enable that on desktops and wheres your JavaScript bridge is the runtime optimized to do touch over that web browser, the web view.

So there are some nuances that need to be flushed out, but its exciting.

So a year from now I want to see Blazor fully working and being super performant on desktop and mobile.

>> Then last question, what about the XAML spaces WinUI, the one XAML that rules them all.

>> Its hard to say. I think thats what the team is hoping to do.

But again the reality is like, there are too many enterprise apps that are still being built on WPF there is nothing wrong with WPF.

Theres nothing wrong with Xamarin Forms either.

So I think if you want to like my two cents, if you want to stick to Windows with XAML, pick either WinUI or WPF, youre going to be fine either way.

If you want to go cross-platform, you get .NET Maui.

>> Then is that Xamarin Forms, is that WinUI.

>> Its Xamarin Forms. But again, thats just one slice because .NET Maui wants to open it up to other things as well.

Essentially, Blazor running on desktop and mobile is essentially running om .NET Maui, there is MVU C# pattern that is also welcome to build apps.

So .NET Maui is not just C# and XAML, but if you are doing C# and XAML, it is Xamarin forms.

>> Cool. We did it less than 20 minutes.

We summed up the wonderful world of desktop development.

>> I think its exciting.

>> It is. Of course, as you mentioned before, theres still the rich third-party ecosystem of the control vendors, you guys, the others.

Lots of good opportunity for people to build modern and very exciting apps.

>> Absolutely. Look around is what I always say.

Before we started greenfield project, look around into what else are you doing, how can you co-share.

Always look around to make sure you have the right tools, the right UI you choose the ecosystem.

Then once youve made the decision, go all in. The good news is the tools are so good on almost every stack that you are set up for success.

>> All right, thanks so much for coming on and sharing your thoughts with us, Sam. Appreciate it.

>> Thanks for having me.

>> Hope you guys all enjoyed that and we will see you next time on Visual Studio Toolbox.

[MUSIC]

Microsoft Visual Studio: Choices in Desktop Development - Software Development