AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.79k stars 2.23k forks source link

VB.NET support #14601

Closed PedroGGaspar closed 8 months ago

PedroGGaspar commented 8 months ago

Discussed in https://github.com/AvaloniaUI/Avalonia/discussions/10387

Originally posted by **ivoryguard** February 17, 2023 > Hello. > I have many VB.NET WPF projects and I want to reuse code snippets and WPF components in them. > I have searched vb.net support of Avalonia UI but it may be uncertain. > Can I use vb.net at Aalonia UI? > Or, is only C# avaliable like Xamarin, ASP.NET Core, Uno and Blazor? >

We also work with VB.NET at our company. We work with C# either, but most people involved in frontend know VB much better than C#, so we mainly use C# in small parts of the backend, as we have a stronger culture around VB here. I am now evaluating the Avalonia project for use in our next generation of software, so I would really appreciate having a VB template project for Avalonia as well.

I just read the discussion #10387, and I need to comment on a piece of text from @MikeCodesDotNET, where he stated: https://github.com/AvaloniaUI/Avalonia/discussions/10387#discussioncomment-8186030

The usage of VB.NET within the developer community has significantly dwindled. This is not an opinion but a reality reflected in metrics such as the 2023 Stack Overflow Developer Survey, where VB.NET is notably absent.

Well I looked at the chart from 2023 Stack Overflow Developer Survey linked in Mike's comment, and not only is it not true that VB.NET "is notably absent" but it is also far above F# in popularity (4 to 5 times more popular on average, to be exact):

All Respondents

Professional Developers

Learning to Code

Other Coders

Also, in TIOBE Index Visual Basic appears on Top 10, while F# is on position 30: https://www.tiobe.com/tiobe-index/

So, if F# has an Avalonia project template, it seems clear to me that VB.NET deserves one too. When I'm browsing the .NET documentation, I always see C# and VB examples, I rarely see an F# example.

MikeCodesDotNET commented 8 months ago

In our previous communications, we've articulated our stance on VB.NET with considerable clarity. I'm of the view that there is no additional information or insights we need to contribute at this time.

Nukepayload2 commented 8 months ago

@PedroGGaspar I'm recently working on adding VB.NET support to AvaloniaUI by writing a custom source generator using my spare time. Because I have a VB WPF project to port to Linux. It's pretty easy to add VB.NET support (at least for Avalonia 11.0.9) if you know how to write Roslyn analyzers. It takes only 4 hours to port and test the x:Name source generator. Here's the project URL: https://github.com/Nukepayload2/Nukepayload2.SourceGenerators.AvaloniaUI I hope you find this useful.

timunie commented 8 months ago

@Nukepayload2 if the project is ready, it can be added to https://github.com/AvaloniaCommunity/awesome-avalonia if you want to. Thank you for your efforts and positive feedback.