Earlier quoted context omitted.
https://isdotnetopen.com/
This always shows up. Comical.
Official proposal for Type Unions in C#
311–315 of 315 posts
Re: Official proposal for Type Unions in C#
#312Really excited for this proposal as it's been the main thing I have to apoligize for when extolling the values of C#. Outside of this it's hard to think of other major features C# lacks for a language. Additionally, excited to now watch this go in and people on HN still act like C# is the same it was 10 years ago.
Proper type aliases would be nice, but I have to say I really enjoy coding C# these days.
Re: Official proposal for Type Unions in C#
#313Really excited for this proposal as it's been the main thing I have to apoligize for when extolling the values of C#. Outside of this it's hard to think of other major features C# lacks for a language. Additionally, excited to now watch this go in and people on HN still act like C# is the same it was 10 years ago.
> it's hard to think of other major features C# lacks for a language Heh yeah well, for better or worse, it seems to be C#’s design goal to have every single feature possible, with multiple variations of each of them. It means it’s able to cater to everyone and doesn’t turn people off the way strongly opinionated languages can. But it can make it a bit tricky to pick up.
I'd really push back against this - where do you see API duplication? IMO the C# team is _incredibly_ conservative with new language features and only add in things that fit a missing part of the language, and when doing so try to also weave in existing C# features to build upon.
I think if anything you may be referring to syntax options? There are a few syntactical ways to do the same things for sure, but I don't think that's bad, as each has their own use. But for bigger tentpole features like records or Span or whatever, they are directly addressing a need and aren't just iterative versions of other things.
Re: Official proposal for Type Unions in C#
#314Earlier quoted context omitted.
Proper type aliases would be nice, but I have to say I really enjoy coding C# these days.
Alias-ing any type was added in C# 12 - do you mean something more than this? https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/cs...
Re: Official proposal for Type Unions in C#
#315Earlier quoted context omitted.
Alias-ing any type was added in C# 12 - do you mean something more than this? https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/cs...
In this case aliasing refers to memory aliasing. As in, given a common struct that represents a type union, you can overlap the fields that satisfy 'unmanaged' constraint (think int, MyStruct(short, long), Guid) between each other, but you cannot overlap them with fields that are or contain object references, because this violates the spec and GC will likely crash upon encountering data that turns into garbage when i…
https://github.com/dotnet/csharplang/blob/18a527bcc1f0bdaf54...