Live data from Hacker News

Welcome to C# 9.0

devblogs.microsoft.com

11–20 of 196 posts

Re: Welcome to C# 9.0

#11
post #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.

With Kotlin and Scala in existence, that ain’t going to happen. C# is as verbose as it was years ago. After years of Scala collections, eithers, options, why would anybody consider C#.

Just look at plumbing with init, data records and with. That is what a case class with val properties in Scala gives.

But congratulations to the team on shipping v9.

Re: Welcome to C# 9.0

#12

> " 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'm actually a strong proponent of .NET core nowadays but I do agree some of the features being added don't seem to justify additional complexity OR just seem to overlap something you can already do in the language. I would prefer if they were a bit more cautious adding some of the features that are purely sugar.

Re: Welcome to C# 9.0

#13
post #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.

This made me chuckle.

I think it's broader than C# -> F# though. Java also has closures and higher-order functions, and in many debates on this forum it seems like OOP proponents aren't aware that these features are grafts from functional programming. OOP programmers also seem to have (finally) come around to the consensus that composition is preferable to inheritance.

So if there is a long con, I think it is about turning OOP programmers into ML or functional programmers. :p

Re: Welcome to C# 9.0

#14
post #8

Earlier quoted context omitted.

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

With Kotlin and Scala in existence, that ain’t going to happen. C# is as verbose as it was years ago. After years of Scala collections, eithers, options, why would anybody consider C#. Just look at plumbing with init, data records and with. That is what a case class with val properties in Scala gives. But congratulations to the team on shipping v9.

Because Scala takes mind-boggingly long to compile. Because Scala has so many features that anything has at least 3 different ways to implement it. Because it’s very easy to write unreadable code in scala, not so much in C#. Because Scala uses JVM, while C# has access to .NET (yes this is an advantage for many developers).

Re: Welcome to C# 9.0

#15
post #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))

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

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

what's the advantage of the first example? i prefer the second, because i don't have to look at the definition of DrawRectangle in order to know that the second argument is a 'Point' object.

Re: Welcome to C# 9.0

#16

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!

It also drove me mad with JSON deserialization. Hopefully this will work nicely with newtonsoft.

Re: Welcome to C# 9.0

#18

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

My guess it's to counter those popular code-golf language comparisons that make c# look verbose for short apps.

Re: Welcome to C# 9.0

#19
post #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))

> graphics.DrawRectangle(RedBrush, new(3, 5, 2, 2)) > graphics.DrawRectangle(RedBrush, new Point(3, 5, 2, 2)) what's the advantage of the first example? i prefer the second, because i don't have to look at the definition of DrawRectangle in order to know that the second argument is a 'Point' object.

The second argument is a Rectangle, which means you'd be repeating 'Rectangle' twice in one line with the second style.

Re: Welcome to C# 9.0

#20
post #17

How does the .NET ecosystem fare these days compared to Java's? Whatever the differences between the languages, on the surface of things it looks like one must be insane not to use Java: https://projects.apache.org/projects.html?language

Apache is somewhat Java centric. I wouldn't use that as a measure of a language's ecosystem. For example, JavaScript has an enormous ecosystem but only 17 Apache projects.
Post reply on HN