Live data from Hacker News

Welcome to C# 9.0

devblogs.microsoft.com

151–160 of 196 posts

Re: Welcome to C# 9.0

#151

> " 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’s basically no downside to adding the feature. But it really helps for playpens and notebooks and teaching. Playpens and notebooks want to focus on the example code in question and it’s good to hide the boilerplate. Teaching is vastly improved because the `main` boilerplate in hello world contains about four lessons worth of material (functions, classes, arrays, and namespaces) that needs to be handwaved to a class of beginners and if they screw up the magic incantations they get scarey error messages.

Re: Welcome to C# 9.0

#152
post #144
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

There is nothing insane here. All depends on context. Games are known to be developed in C# and the amount of those dwarfs Java's counterpart. There are other areas with the affinity of "insanity" leaning either way.

Amazing Princess Sarah vs. Minecraft, sure.

Re: Welcome to C# 9.0

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

Re: Welcome to C# 9.0

#155
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…

F#'s strengths are also some of its weaknesses. Re: H-M type system (a) the lack of decls makes code nice to look at when writing, but coming back to it a year later or w/someone else's code, it can be hard to follow. (b) Sometimes the errors are still quite baroque! And the tooling (esp. 3rd party) isn't as prevalent.

Partial application can be one of those write-only code constructs unless used in very simple/canonical patterns. I'd also like to have a Scala like "hole" syntax with positional args -- this is also need to alleviate the need to write a (fun -> ...) when calling methods on object in a |> pipeline. And speaking of pipeline, they look nice, until you want to debug through them. (Need something like Ozcode's LINQ debugger for pipelines.)

F# also (last I checked) doesn't do the level of optimizations I'd like to see, such as removal of tuple creation between fn's when there never actually stored, etc.

Although I understand the rational for the Curried form for fn types, it seems a bit pedantic to present things this way by default -- seeing (int -> string) -> Foo -> (bar list -> baz -> qux) is IMHO harder to look at than the standard presentation. Although C# really needs seq and post-fix types -- "IEnumerable" is an eye-sore compared to "Foo seq".

But it's hard to go back to any lang w/o DU's...

Re: Welcome to C# 9.0

#156

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…

Feeling the same here. It's elegant, and imo easier to read than most languages. There aren't many choices of libraries in C#, but they cover most use cases. Still I found myself happy to publish to NuGet my own package because I love exploring the language and its features.

Now developing in Python at work, I can find a multitude of packages for every need I have to meet, which is perfect for productivity, but I feel I can never understand the language enough because all I do is to import some packages and get work done.

I really hope C# gets more popular among devs. Where I live only large non-tech companies use it internally, which might explain why there are not many open source libraries in C# compared to other languages.

Though, with all the comments here saying C# is turning into F#, I'm tempted to try out F# as my first functional programming language now.

Re: Welcome to C# 9.0

#157
post #113

Earlier quoted context omitted.

It's by far my favorite general purpose language. Works well everywhere, and the best tools around.

C# is a very good language. I like it a lot, and Visual Studio is a fine IDE, but the tools pale in comparison to the JVM tools (Maven, Gradle, IntelliJ, Eclipse, Spring Boot, GraalVM, etc)

I thought Visual Studio 2019 is already great. How does it compare to JVM tools though?

Re: Welcome to C# 9.0

#158
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))

I would love for C# to get rid of "new" as F# does -- why do we need it?

var p = Point(3,5).

For cases like this it's no big deal, but deep/complex initalizers (like expression trees, etc.) look horrible in C# unless you create static helper fn's to init objects.

Re: Welcome to C# 9.0

#160
post #75

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…

Didn't C# start with Microsoft poaching the lead Delphi architect from Borland? A lot of people loved Delphi back in the day for its design too.

I’ve been using Delphi before and it looks like a grown/better Pascal. C# is a c-family language which seems weird right after the switch, however you start appreciate C syntax a bit later.

I think C# was an attempt to design MS Java which is better than Java

Post reply on HN