Live data from Hacker News

Welcome to C# 9.0

devblogs.microsoft.com

71–80 of 196 posts

Re: Welcome to C# 9.0

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

Can you elaborate on ugly side?

Re: Welcome to C# 9.0

#72
post #62
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.

Better not.

Perl# basically.

Re: Welcome to C# 9.0

#73
post #70

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.

> 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. As someone with background from Java but who has worked a lot with .Net Core lately, I guess it might depend on what part of .Net you talk about. .Net Core worked extremely well on Linux for all use cases I saw, mostly web applications, cli tooling and b…

Deep code profiling of the JVM is still a lot better than Linux .NET Core. I still like C# though.

Re: Welcome to C# 9.0

#74

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.

I think that it's unfortunate they stuck with that example instead of the classic point class example for positional args. In general the positional destructuring is not great, but there are some cases where it is nice and readable. Because of that I'm glad it's not the default that all record classes get it.

    var (f, l) = person;
is gross and hard to understand.

    var (x, y) = point;
is simple and readable.

Re: Welcome to C# 9.0

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

Re: Welcome to C# 9.0

#76

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?

You can write Winforms like code in WPF and get better layout capabilities. If you stay away from MVVM then WPF is pretty straightforward.

Re: Welcome to C# 9.0

#77
post #68
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…

Well F# obviosly never gained enough momentum and C# has to grow somewhere so why not in this direction. All "big" languages are gaining more and more functional and declarative features each version. I always remember this chat by Simon PJ, the "father" of Haskell about convergence of languages in features https://m.youtube.com/watch?v=iSmkqocn0oQ

> Well F# obviosly never gained enough momentum

As a member of the F# Evangelism Strike Force (to use an n-gate ism), I want to argue this point but there is not enough info to determine what 'enough momentum' means.

I can produce, without leaving F#: libraries, cli apps, windows services, windows desktop apps, websites (asp.net core + giraffe), web apps, SPAs (SAFE stack), and more. If I target .NET Core, I can run my F# in windows land, linux land, and anywhere else .net core has been ported. What features does C# offer that F# doesn't, aside from being more familiar to lots of MS devs? Even I started my dev journey with C# on Windows Mobile 5 via .Net Compact Framework.

Cons: The F# tooling is just worse than C# tooling. Compare the 20-year old language with support since Visual Studio 2003 .NET to the one that has for some reason focused on the VSCode + Ionide plugins rather than the tooling that VS users run into and even I can't really argue that C# has better tooling. Biggest weakness of F# is all the wonkiness when it comes to common tasks like making, running, building, publishing codebases. The use case of something common like 'make me a new blank app, I want it to use paket for dependencies and to spit out an alpine docker image with .net core sdk at the end' should be 1 command, then triggerable from the VS Debug/F5 button. It just isn't that yet.

> C# has to grow somewhere why not this direction

I'd rather C# lean more FP than lean more OOP, sure, but _does_ C# have to grow somewhere? Can't a language spec be declared good enough / maintenance mode at some point so the programmers can focus their learnings on fuller understanding of the spec itself, as well as improving the implementations and tooling around a language?

Re: Welcome to C# 9.0

#78
It seems using toplevel programs could make it harder to find the entry point to a program. Is there an easy way, given a built assembly, to know which source file the entry point is?

Re: Welcome to C# 9.0

#79
post #38

Earlier quoted context omitted.

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

It has the benefit of 15 years more hindsight. As an example, during this time the development community figured out that using immutability as the default brings benefits. Kotlin is designed with this in mind, but C# isn't - e.g. C# has this cool feature for object initialization which is so handy and all developers use it. Except for - it doesn't work with immutable classes (the ones with readonly fields). As an ef…

> Except for - it doesn't work with immutable classes (the ones with readonly fields).

Well good thing they're adding that in C# 9 then

Re: Welcome to C# 9.0

#80
post #73
post #70

Earlier quoted context omitted.

> 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. As someone with background from Java but who has worked a lot with .Net Core lately, I guess it might depend on what part of .Net you talk about. .Net Core worked extremely well on Linux for all use cases I saw, mostly web applications, cli tooling and b…

Deep code profiling of the JVM is still a lot better than Linux .NET Core. I still like C# though.

Probably, haven't tried really on .Net but Java is awesome.

Another point where it is really hard to get people to actually understand the magnitude of the difference is in IDE support, what exists and what you get out of the box.

I mostly enjoy programming in .Net Core a lot but there are times when the difference becomes extremely visible.

Post reply on HN