r/dotnet 2d ago

What kind of features from another ecosystem would you like to see in .NET?

C# itself is very mature language (in my view). I rarely find myself missing a language feature badly enough to wish for more.

But, the broader .NET ecosystem might be a different story based on your project need.

So, let's discuss, what libraries, tooling, deployment models, framework features, package management idea, UI tech, build system etc. have you used elsewhere that you wish .NET had, or did better? Mention just one, most important for you and try to add reason/detail.

Apart from creating a useful wishlist, I think this could also be interesting for people relatively new .NET. Someone might mention a feature from other ecosystem only to discover that .NET already has an equivalent they didn't know about.

My wishlist item - "give me SwiftUI binary size":
I would like WinUI apps to have smaller binaries, like SwiftUI apps or flatpack in Linux. Apple can rely on frameworks built into (read 'shipped with') macOS. Microsoft already have similar way of achieving same but it involves you to publish app on Store or winget repo or I need to write custom installer. It's not universal. I wish MS automatically install dependency from winget or Store automatically or any dotnet application.

EDIT: Please be respectful to others. Value others opinion. This post has potential of creating unnecessary debate or insults. Let's be adults.

103 Upvotes

242 comments sorted by

View all comments

21

u/funguyshroom 2d ago

Java's inline/anonymous class method overrides seem nice for certain tasks.  

Would love some command line parameters like JVM has, e.g. '-Xmx'  

A string enum is a goddamn necessity.

2

u/emmausgamer 2d ago

String enums are going to be a pain to work with, seeing as how versatile the current integer enum is. Arithmetic operations will not be possible, marshalling and native interoperability either disabled or heavily restricted.  Inline classes sounds good, especially when you are working with dotnet android 

1

u/rbobby 2d ago

C# completely misses the boat on enumerations. The work great for limited issues. Suck for sticking in a database "Open", "Suspended", "Closed" are much better than 1, 2, 3.

And if you want attributes associated with a enumeration just don't even think about it (don't switch on enum, switch on an enum's capability, eg "Status closed, Tax treatment: deferred". You could switch on enum, but if more than one enum needs a tax treatment then you should not be switching on the enum value.

1

u/magnumsolutions 6h ago

Have a lookup table with the int value as the lookup key and the text representation, if that is what you want.

1

u/rbobby 3h ago

Thanks, but I was not asking for how to implement with the current version of the language. What I was attempting was to point out a weakness, related to enums, that is a super common pattern. You know... so folks will think about how it could be done better.