Live data from Hacker News

Welcome to C# 9.0

devblogs.microsoft.com

161–170 of 196 posts

Re: Welcome to C# 9.0

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

[deleted]

Re: Welcome to C# 9.0

#162
As usual a beautiful, beautiful language. As expected, they start with something simple and build layers upon layers all connected via simple concepts.

Add init to a property, make its class a data class, and boom you have immutable beautiful class. Kudos to these designers.

(This is similar to AutoValue in Java / data class in Kotlin, but it feels a lot more elegant and connected and simple than what these other languages offer)

Re: Welcome to C# 9.0

#163

Earlier quoted context omitted.

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.

Kotlin allows Google to hang out in Java 8 forever. If they want new features they can just add them at the Kotlin layer. Insulates them from OpenJDK and any changes Oracle wants to make. All great opportunities to fragment the Java ecosystem

Kotlin is written by JetBrains.

Re: Welcome to C# 9.0

#164
post #75

Earlier quoted context omitted.

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

Your both right, C# was MS Java-but-better designed by the designer of Delphi, who had recently (perhaps specifically for that project) been hired by MS.

Re: Welcome to C# 9.0

#165

Earlier quoted context omitted.

It really is wonderful. Used it at work years ago and still miss it dearly. The only thing I don't miss is the lack of community. Many things you can get for free in Java/Python cost money in Microsoft land. Even common stuff like decent excel and PDF support. Its getting better but was still the case last time I looked. What C# needs is Java interop. The VM and bytecode structures are similar enough for it to work.…

I wouldn't expect that to change any time soon. The Microsoft/Sun lawsuit still stings inside the company and has legal impact decades later ( https://www.cnet.com/news/sun-microsoft-settle-java-suit/ ). It's the reason why, for instance, you can't download Windows 98 or Visual Studio 6 on MSDN/Visual Studio subscriptions. Microsoft is now friendlier to open source than it has been, but I would be shocked if they eve…

And I'm sure that the Google/Oracle lawsuit hasn't exactly improved things, either. Not to mention the recent licensing changes. Java is such a can of worms legally that it's surprising that anyone sensible would want to touch it with a ten-foot pole.

Re: Welcome to C# 9.0

#166

That "Init-only properties" feature is huge. I spend so long at work when working on tests making stubs of objects with private setters etc (e.g. DTOs). That work is essentially gone now, awesome!

Are you me? That's exactly the same reason why this feature has me so excited. Will save me so much time when testing.

Re: Welcome to C# 9.0

#167

Earlier quoted context omitted.

My understanding is that the dotnet runtime and powershell are both decent codebases. https://github.com/dotnet/runtime https://github.com/PowerShell/PowerShell

Looking at a random file in Powershell, the first thing I see is: private string _typeName; /// /// Add new type name to the specified object for TypeNameSet. /// [Parameter(Mandatory = true, ParameterSetName = "TypeNameSet")] [Parameter(ParameterSetName = "MemberSet")] [Parameter(ParameterSetName = NotePropertySingleMemberSet)] [Parameter(ParameterSetName = NotePropertyMultiMemberSet)] [ValidateNotNullOrEmpty] publi…

since c# 3 (2008) this would normally be expressed as

public string TypeName { get; set; }

not sure why it's not here, could just be older code. The [Parameter] etc stuff is all powershell-specific metadata that defines how to use it from the powershell language.

Re: Welcome to C# 9.0

#168

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.

Note that, even without positional records, C# already allows types to support this syntax: https://docs.microsoft.com/en-us/dotnet/csharp/deconstruct

(the "Person" type would have to implement a "Deconstruct" method with two string out parameters, or alternatively someone could write an equivalent extension method)

Re: Welcome to C# 9.0

#169

Earlier quoted context omitted.

It really is wonderful. Used it at work years ago and still miss it dearly. The only thing I don't miss is the lack of community. Many things you can get for free in Java/Python cost money in Microsoft land. Even common stuff like decent excel and PDF support. Its getting better but was still the case last time I looked. What C# needs is Java interop. The VM and bytecode structures are similar enough for it to work.…

I wouldn't expect that to change any time soon. The Microsoft/Sun lawsuit still stings inside the company and has legal impact decades later ( https://www.cnet.com/news/sun-microsoft-settle-java-suit/ ). It's the reason why, for instance, you can't download Windows 98 or Visual Studio 6 on MSDN/Visual Studio subscriptions. Microsoft is now friendlier to open source than it has been, but I would be shocked if they eve…

.NET Java interop is literally Xamarin on Android. Java interop worked for 15 years+, it is just not commonly known and was a community project.

Re: Welcome to C# 9.0

#170

Earlier quoted context omitted.

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

Your both right, C# was MS Java-but-better designed by the designer of Delphi, who had recently (perhaps specifically for that project) been hired by MS.

The little ugly fact is that Anders was also involved in the Microsoft Java effort.
Post reply on HN