Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not copy the ugly sides of C# #168

Closed
marinasundstrom opened this issue Apr 29, 2020 · 6 comments
Closed

Do not copy the ugly sides of C# #168

marinasundstrom opened this issue Apr 29, 2020 · 6 comments

Comments

@marinasundstrom
Copy link

C# has a long history. There are a lot of trade offs that have been made during its evolution in order to not break things. Some between the language and runtime support - which in .NET are two different things and teams.

Do not copy features and behaviors directly from C# without understanding why it looks like it does.

For instance:

Is System.Nullable really necessary for value types? In my understanding, in .NET it exists just because they had to add it to the runtime at a later stage.

There is an opportunity to make this right by implementing unified nullable types from the start - for both reference types and value types.

@bfiete
Copy link
Collaborator

bfiete commented Apr 29, 2020

I have tried to be aware of these kinds of things during the design, but I'm not sure what you're proposing for nullable valuetypes. Do you find it problematic that there's actually library code to implement parts of it rather than just being purely implemented by the compiler? That's also true of Arrays by the way. And delegates, and even System.Object...

@blanchet4forte
Copy link

I think a more compelling example would be something like IEnumerable. There is a great blog post about it here:

https://blog.paranoidcoding.com/2014/08/19/rethinking-enumerable.html

Of course, that is just one guys opinion. I believe Rust Iterator is a great example of achieving all of the goals laid out in that blog.

@marinasundstrom
Copy link
Author

I am also thinking about handling date and time.

I remember that there was a proposal to add a Date class in .NET:s DateTime API. dotnet/runtime#14089

There is a library called NodaTime which handles date amd time better than .NET:s native API.

@bfiete
Copy link
Collaborator

bfiete commented May 1, 2020

Oh yes, it would be my dream come true if I were to wake up one morning to find a PR completely replacing our directly-lifted-from-.NET Date/Time functionality in our current corlib.

@marinasundstrom
Copy link
Author

I would love to contribute I'm just gonna figure out what I can do.

I really love the idea of a language and framework that is familiar to me as a .NET developer but for native code.

Keep up the good work! @bfiete

@bfiete
Copy link
Collaborator

bfiete commented May 3, 2020

Closing this overly-general item, but feel free to create new specific items for individual ideas/requests.

@bfiete bfiete closed this as completed May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants