Live data from Hacker News

Welcome to C# 9.0

devblogs.microsoft.com

51–60 of 196 posts

Re: Welcome to C# 9.0

#51
post #42

Earlier quoted context omitted.

yeah for composition - I ALWAYS liked it much better!

Some languages even have syntax sugar for it built-in, cough Kotlin cough class Foo(b: Bar) : Bar by b

This is the most controversial feature of Kotlin.

The delegation is better than inheritance because you don't get all the methods from the base class if you don't need them.

At my company, we have banned it, because if you add a method to Bar the method is automatically added to Foo which makes the delegation as fragile as the inheritance.

Re: Welcome to C# 9.0

#52
post #38

Earlier quoted context omitted.

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 :}

May I ask why do you think kotlin is best designed?

I think kotlin is ugly hack, if you take away the superficial syntax (?) it will start showing ugly side. I think it only gotten popular because of Googles push due to Oracle Java lawsuit.

Re: Welcome to C# 9.0

#53
Positional records are a terrible idea, one of the best things about C# is readability

var (f, l) = person;

is so much worse than

var (f, l) = (person.FirstName, person.LastName);

I don't want to have to refer to documentation or class implementation to understand what a destructuring expression does.

Re: Welcome to C# 9.0

#54

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

Why don't people understand that LINQ isn't just a C#-ish way to write SQL-like statements? So many people are comparing their libraries to LINQ without understanding what it actually does.

LINQ brought System.Linq.Expressions and IQueryable to .NET which allows so much more than just filtering and grouping data. You can write entire data providers with LINQ and parse arbitrary expression trees in any way you like.

Entity Framework (Core) utilizes this very well. It doesn't just query an SQL database and then use LINQ's Where, Select etc. to manipulate the data but parses everything the developer has written to an expression tree and then generates an SQL statement at runtime.

Re: Welcome to C# 9.0

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

[deleted]

Re: Welcome to C# 9.0

#56
post #52
post #38

Earlier quoted context omitted.

May I ask why do you think kotlin is best designed?

I think kotlin is ugly hack, if you take away the superficial syntax (?) it will start showing ugly side. I think it only gotten popular because of Googles push due to Oracle Java lawsuit.

I don't think Kotlin is being pushed because of the Oracle lawsuit. Most of Oracle's complaints were at the VM and standard library level, which Kotlin doesn't help with.

Re: Welcome to C# 9.0

#57
I'm VERY excited for Record types. Automatically having automatically deep equality in data types is going to really help maintainability- no more "developer adds a field to the type but not to the equals function" type errors.

Re: Welcome to C# 9.0

#58

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 by far my favorite general purpose language. Works well everywhere, and the best tools around.

Re: Welcome to C# 9.0

#59

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

Totally agreed on all these, though I've personally gotten around the last one by making use of `using static System.Console;` -- then you can just do `WriteLine(...);`

It doesn't solve the fundamental issue, but it definitely makes things clearer for me.

Re: Welcome to C# 9.0

#60

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?

It seems to be alive and well:

https://devblogs.microsoft.com/dotnet/windows-forms-designer...

Sadly only in Visual Studio and not Visual Studio Code. And yes, there is probably no one who used winforms that wouldn't be shocked by WPFs steep learning curve.

Post reply on HN