Live data from Hacker News

Welcome to C# 9.0

devblogs.microsoft.com

41–50 of 196 posts

Re: Welcome to C# 9.0

#41

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…

It's about trade off. A language that keep getting new features every year, will make some users happy, but will lose compiler speed and it will be harder to learn.

Re: Welcome to C# 9.0

#42

Earlier quoted context omitted.

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!

Some languages even have syntax sugar for it built-in, coughKotlincough

    class Foo(b: Bar) : Bar by b

Re: Welcome to C# 9.0

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

The number of repository is not the important metric that apache has. What matter is to have at least one industry grade™ open source library for anything™ Most of apache libs are each ~20000 commits This amount of human resources is unmatched in any other platform.

Re: Welcome to C# 9.0

#44

Earlier quoted context omitted.

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

The point of C# being a better Java is nowadays mostly obscolete because of Kotlin being THE better Java. As for LINQ see https://github.com/mythz/kotlin-linq-examples/blob/master/RE...

Any of the otherlang-linq projects miss the forest for the trees, the whole point of LINQ is that it's not a set of chain-able methods on IEnumerable - providers get access to the expression tree and can use them to do all sorts of crazy things (see: EntityFramework, Linq2Sql).

I love Kotlin and I don't really get a hankering for LINQ when I'm using it, but I wish people would stop trying to say "but we can do that too!" when they really can't.

Re: Welcome to C# 9.0

#45

Earlier quoted context omitted.

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

All your points except the last one do not apply to Kotlin

is kotlin slow to compile

Re: Welcome to C# 9.0

#46

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

In C# I'd like to able to :

- declare a namespace for the file (no indentation)

- declare that the file is a class and can only contain one (top level) class (still no indentation)

- `using` statements that don't import every symbol into my namespace :

    using System.Console;
    ...
    Console.WriteLine();
instead of :

    using Sytem;
    ...
    Console.WriteLine(); // where does "Console" come from ? god/IDE only knows
But yes, no to top-level programs.

But alreay with these few changes, I've saved 10% of the 80 columns width. I've made it easy to read a file without an IDE. You can start to write actual code at indentation level 0. I've made it easy to have one class per file and hard to have two class per file, in the spirit of making good pratice easy and bad practice hard.

Re: Welcome to C# 9.0

#47

What is the winforms simple (ie, drag and drop form designer, click through for code) current windows development recommendation. I've seriously lost all track of how to just get up and going. I've tried UWP/WPF etc - they felt like a bit of nightmare for quick and go, but the tooling now seems to have dropped winforms? I couldn't get the form designer to actually show up even on a WinForms project?

I'm no longer close to .NET desktop GUI development but even today, if I had to do something I'd start a new WinForms project.

Re: Welcome to C# 9.0

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

I am surprised that hasn't been done already.

Re: Welcome to C# 9.0

#49
post #47

What is the winforms simple (ie, drag and drop form designer, click through for code) current windows development recommendation. I've seriously lost all track of how to just get up and going. I've tried UWP/WPF etc - they felt like a bit of nightmare for quick and go, but the tooling now seems to have dropped winforms? I couldn't get the form designer to actually show up even on a WinForms project?

I'm no longer close to .NET desktop GUI development but even today, if I had to do something I'd start a new WinForms project.

For simple utility apps, it's lighting fast and easy. Now with .net core high and DPI support it's even better.

Re: Welcome to C# 9.0

#50
post #45

Earlier quoted context omitted.

All your points except the last one do not apply to Kotlin

is kotlin slow to compile

It's certainly slower than javac (which is pretty freaking fast - maybe not in comparison to go, but it's no slouch), but it certainly mops the floor with scalac.
Post reply on HN