Live data from Hacker News

Welcome to C# 9.0

devblogs.microsoft.com

1–10 of 196 posts

Re: Welcome to C# 9.0

#2
> "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?

Re: Welcome to C# 9.0

#3
That "Init-only properties" feature is huge.

I spend so long at work when working on tests making stubs of objects with private setters etc (e.g. DTOs). That work is essentially gone now, awesome!

Re: Welcome to C# 9.0

#4

> " 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?

I agree. The only advantage I can think of is smaller hello world programs. And that seems to be important from a marketing perspective: people new to the language won't perceive it as a verbose language.

Re: Welcome to C# 9.0

#5

> " 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?

Does seem a bit of a pointless feature, especially as that very minimal boilerplate is auto-generated by any decent IDE anyway.

And I used to primarily work in scripting languages like Ruby where you'd get this 'feature' out of the box (although usually ended up writing a 'Program' class and a constructor/main method anyway for the scoping)

Re: Welcome to C# 9.0

#6

> " 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?

There is already a scripting dialect of c#, that seems mostly used in some web apps and for learning purposes. So they want to "streamline" this aspect, because currently this dialect requires a lot of custom handling. https://github.com/dotnet/csharplang/issues/2765

Re: Welcome to C# 9.0

#7
This seems similar to the joke where after Brexit, the Germans are angry that english is still the official EU language and they change the english language until it sounds a lot like german.

In a few years, C# 20.0 will have only one release note: Changed the name from C# to F#

Re: Welcome to C# 9.0

#8

This seems similar to the joke where after Brexit, the Germans are angry that english is still the official EU language and they change the english language until it sounds a lot like german. In a few years, C# 20.0 will have only one release note: Changed the name from C# to F#

C# is Microsoft Research's 20-year-long con to turn Java programmers into OCaml programmers so slowly that they don't notice.

Re: Welcome to C# 9.0

#10
Well, we're getting closer to F#. Still waiting on discriminated unions and expression blocks. (Yes, I know, discriminated unions in F# are just implemented in the class hierarchy. But it's awfully nice syntactic sugar.)

> Point p = new (3, 5);

At first glance, not impressive, since you could just do:

> var p = new Point(3,5);

However, it would clean up code like:

> graphics.DrawRectangle(RedBrush, new(3, 5, 2, 2))

Post reply on HN