Live data from Hacker News

Welcome to C# 9.0

devblogs.microsoft.com

21–30 of 196 posts

Re: Welcome to C# 9.0

#21
post #19

Earlier quoted context omitted.

> 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.

I think this clarification proves his point, and I tend to agree that I prefer the more explicit, verbose style.

Re: Welcome to C# 9.0

#22
post #19

Earlier quoted context omitted.

> 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.

That's not obvious from the function name though. The function definition could easily be `DrawRectangle(SolidColor, CornerRadii, Point)` and you wouldn't know by seeing a bunch of `DrawRectangle(RedBrush, new(1,2,4,5), Point(4,5,2,2))` would you?

It's still nice to have the option in cases where it improves readability (maybe with named args or sth)

Re: Welcome to C# 9.0

#23
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

You'd be insane because a major Java project maintainer contains a lot of Java..? That's like pointing at Microsoft's github repo and saying you'd be insane to use anything but C# and TypeScript.

Personally I think this is a better source: https://octoverse.github.com#top-languages

Or this: https://insights.stackoverflow.com/survey/2019#technology

Re: Welcome to C# 9.0

#26
I still think C# is one of, if not the best of designed languages exist. Even it moves in much smaller steps than it was before I think it's for good.

I left .NET land at 6.0 and .NET 4.x versions mostly because of Windows eco-system (small open source community, almost no alternatives to out of the MS things, bad linux support). Since that I've been working with Java, Swift,JS, Python, Golang and I still think that C# is one of the best-designed languages. Very few of them keep evolving through the decades, hopefully it can become the language of the year at some point, always liked to see how new features got implemented under the hood and what kind of features get into next release.

Well done C# team

It's amazing how the language advances over years

Re: Welcome to C# 9.0

#27
Damn, this is fantastic. One big syntactical thing I should really put in a proposal for is null-conditional returns. Turning

    if(foo != null) return foo;
Into

    return? foo;
It fits perfectly with the existing null coalescing operators and such, while really cleaning up a lot of code.

Re: Welcome to C# 9.0

#28
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

.NET ecosystem is large, but still windows-centric. If I was choosing between java and C# for a startup, I'd definitely consider C# because it does seem to be a better java (properties and LINQ are the first 2 things that come to mind).

But realistically if you're not doing .NET on windows, you're still an early adopter who's going to run into weird issues that you won't have to deal with on java.

Re: Welcome to C# 9.0

#29

I still think C# is one of, if not the best of designed languages exist. Even it moves in much smaller steps than it was before I think it's for good. I left .NET land at 6.0 and .NET 4.x versions mostly because of Windows eco-system (small open source community, almost no alternatives to out of the MS things, bad linux support). Since that I've been working with Java, Swift,JS, Python, Golang and I still think that…

To me C# is the second best designed language, the first being IMHO Kotlin. I'm very interested in what you think would make C# more well designed than the latter :}

Re: Welcome to C# 9.0

#30
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.

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 t…

yeah for composition - I ALWAYS liked it much better!
Post reply on HN