News for hackers. Stuff that matters.
Re:Welcome to C# 9.0 by The_rationalist on Wednesday May 20, 2020 @02:59PM (#23250445)
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 :}
Re:Welcome to C# 9.0 by jayd16 on Wednesday May 20, 2020 @04:09PM (#23251184)
Overall I find the syntax to be a little too inconsistent for the sake of conciseness but its a well designed language. It might just be my lack of experience and the amount of features in Kotlin.

Code examples have a lot of what looks like lambda callback hell and I find it hard to read but again, I might just need more practice.

Re:Welcome to C# 9.0 by oaiey on Thursday May 21, 2020 @01:49AM (#23255212)
Interestingly, both are done by companies who care about developer productivity. When you here Anders Hejlsberg talking it is all about productivity (C# and TypeScript). I do not know the kotlin designers, but I bet they talk similar.
Re:Welcome to C# 9.0 by bulldoa on Wednesday May 20, 2020 @03:08PM (#23250536)
May I ask why do you think kotlin is best designed?
Re:Welcome to C# 9.0 by The_Colonel on Wednesday May 20, 2020 @03:39PM (#23250859)
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 effect developers dislike to use immutable classes since it's not ergonomic in C# and instead use standard POCO.

Another example is that C# still in this age does not support readonly parameters and local variables (which even Java and JavaScript (!) support). In Kotlin "readonly" local variables is the idiomatic code practice which doesn't make code any more verbose. And in the case they decide to add it to C#, it will have to be at the cost of verbosity (similarly to how Java does it) because of backwards compatibility.

Re:Welcome to C# 9.0 by belinder on Wednesday May 20, 2020 @03:54PM (#23251018)
> 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 by The_Colonel on Wednesday May 20, 2020 @04:04PM (#23251128)
Oh, cool, I didn't notice that!

Still, they are playing catch-up here.

Re:Welcome to C# 9.0 by illvm on Wednesday May 20, 2020 @04:43PM (#23251548)
I mean... if you go that route then I would say Kotlin isn't really ready to be used as a production language in most places due to the severe lack of tooling, especially when it comes to things like static analysis. Sure ktlint is there, but the rules library is lacking.

So from that perspective, Kotlin is playing catch-up.

Re:Welcome to C# 9.0 by The_rationalist on Thursday May 21, 2020 @06:24AM (#23256758)
Static analysis is the only weak point of kotlin that I'm aware of.. Intellij Idea has by default something that might be considered as static analysis.

There is also detekt but it's true it is inferior to solution that Java has. https://github.com/detekt/detekt

PMD is targeting kotlin initial support for their next major release https://github.com/pmd/pmd/issues/419

I've answered a jetbrains survey recently and they revealed they are working on a new product that would be a full fledged static analyser, maybe this would solve the issue?

Re:Welcome to C# 9.0 by The_Colonel on Wednesday May 20, 2020 @04:53PM (#23251665)
Discussion was about the design of the language only.
Re:Welcome to C# 9.0 by djanogo on Wednesday May 20, 2020 @03:20PM (#23250657)
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 by monocasa on Wednesday May 20, 2020 @03:26PM (#23250711)
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 by eggsnbacon1 on Wednesday May 20, 2020 @06:48PM (#23252908)
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
Re:Welcome to C# 9.0 by monocasa on Wednesday May 20, 2020 @07:00PM (#23253017)
OpenJDK was always fine for them to pull in, being GPLed. They got in trouble because they based their class library on Apache Harmony originally, and Sun pulled the TCK rug out from under Harmony.
Re:Welcome to C# 9.0 by t-writescode on Thursday May 21, 2020 @12:06AM (#23254685)
Kotlin is written by JetBrains.
Re:Welcome to C# 9.0 by searchableguy on Wednesday May 20, 2020 @03:43PM (#23250912)
Can you elaborate on ugly side?