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.
Welcome to C# 9.0
21–30 of 196 posts
Re: Welcome to C# 9.0
#22Earlier 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.
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
#23How 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
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
#24Re: Welcome to C# 9.0
#25which visual studio version will support c# 9?
Re: Welcome to C# 9.0
#26I 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 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
#28How 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
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
#29I 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…
Re: Welcome to C# 9.0
#30Earlier 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…