Live data from Hacker News

Welcome to C# 9.0

devblogs.microsoft.com

191–196 of 196 posts

Re: Welcome to C# 9.0

#191

What is an example of a really good codebase written in modern C#? There are quite a few appealing things about the language, but I'm having trouble shaking the feeling that it's kind of like Java. I know both languages have evolved a lot, but some codebases might get stuck in some old patterns.

I would point to https://github.com/dotnet/roslyn itself as an example of a modern codebase. We try to adopt and use all of the new language features there as we write them to try and determine if the ergonomics are good.

Re: Welcome to C# 9.0

#192
post #61

Look - I don't have anything deep to say here. I can only say that between 'records' and 'with-expressions' now in C#, I as a hobbyist F# developer feel like I'm being shaken down by the mafia. C# designers: "Hey, nice language features you have there. I'll just borrow them for a bit ok, it'll be fine..." Later, C# programmers: "why would I learn F#, C# does all the same stuff!" (even though it doesn't) Edit: I admit…

If anything, these new things added to C# only make me want to use F# to a greater degree. The reasoning is simple: clearly these things are good (or at least acceptable) ideas since C# adopts them, but C# makes it more complicated to use them.

Put another way: if I'm going to use these features anyway (hint: now that they're in C#, I am) why wouldn't I do it in the language designed around them, rather than the one where they are bolted on?

When C# didn't have these features, there was ironically more reason to use C# because then these idioms could be argued to not be accepted by the community to the same degree.

Re: Welcome to C# 9.0

#193

> " Top-level programs " I'm not usually one for causal dismissals but that made me cringe. What on earth is the use case for getting rid of that tiny bit of boilerplate, relative to the complexity it adds to the language definition, that makes it worthwhile?

In C# I'd like to able to : - declare a namespace for the file (no indentation) - declare that the file is a class and can only contain one (top level) class (still no indentation) - `using` statements that don't import every symbol into my namespace : using System.Console; ... Console.WriteLine(); instead of : using Sytem; ... Console.WriteLine(); // where does "Console" come from ? god/IDE only knows But yes, no to…

Isn't this basically stuff F# nearly defaults too?

Re: Welcome to C# 9.0

#194

As much as I love F#, C# now has enough of F#'s core features that I'll probably use F# less due to the better tooling for C# code. (Resharper, Ozcode, etc.) C# still needs DU's though... Meta-programming support is kinda better if F#, but isn't great in either language unfortunately - you could argue the as C# is based on Rosyln that it is actually better.

I'm viewing it exactly the other way around: if my co-workers have to learn this stuff anyway, I can just as well just use F#, which implements these things in more convenient ways.

Re: Welcome to C# 9.0

#195
post #180

I would like to know what is the future of Mono now that dotnet core is crossplatform and Microsoft bought Xamarin. Mono remains the best (only?) solution to call C# from C++ in a crossplatform way using embedding.

Well, Mono is now one of the two .NET runtimes shipped with .NET 5+. Like you mentioned, it is better for embedded and porting. That the reason they I integrate it. Mono as a project is a dead man walking. And honestly, that is good. Unity as the major other user is surely heading for .NET 5. I would suggest to learn to embed .NET Core 3.1 and later .NET 5. Surely possible (see Unity, interop with WinRT etc, ..).

How is that a good thing? Isn't it reminiscent of embrace, extend, extinguish?

Re: Welcome to C# 9.0

#196
post #195
post #180

Earlier quoted context omitted.

Well, Mono is now one of the two .NET runtimes shipped with .NET 5+. Like you mentioned, it is better for embedded and porting. That the reason they I integrate it. Mono as a project is a dead man walking. And honestly, that is good. Unity as the major other user is surely heading for .NET 5. I would suggest to learn to embed .NET Core 3.1 and later .NET 5. Surely possible (see Unity, interop with WinRT etc, ..).

How is that a good thing? Isn't it reminiscent of embrace, extend, extinguish?

Mono was never usable for server workloads. Its niche was the same as it is today: being portable and embeddable. .NET 5 gains that by integrating Mono. The benefits for that use case is the better tooling and ecosystem of .NET 5. With Xamarin, .NET Core and Unity doing one agenda every. NET dev wins. Mono and the .NET Framework are dead.

.NET 5 is MIT licensed and even gets attention for source focused builds (like needed by Linux distros). Redhat officially ships is own version. Summary: that is exactly not EEE.

Post reply on HN