News for hackers. Stuff that matters.
Re:Java 16 by cmckn on Tuesday March 16, 2021 @02:48PM (#26481135)
Not considering async/await (because I'm not really a fan), they're neck-and-neck in my opinion. I don't think C# has been as careful with its abstractions and the general aesthetic of the language to the degree that Java has; but in many cases you can almost compile a block of Java as C# and vice versa. I think the primary differentiator is what toolchain/ecosystem you prefer, and I'm solidly on the Java side of that line.

That being said, I'm currently getting paid to write C#, so if you've got any resources for converts, I'd love them! :)

Re:Java 16 by jayd16 on Tuesday March 16, 2021 @09:58PM (#26485626)
What do you think is more elegant in Java than C#? I like both but I think things like LINQ, delegates, reflection, nullabity and even properties are much cleaner in C# vs streams (exceptions?), consumer<T> (weird names. accept? not invoke?), erasure and then just in general its not as nice, Optional<T> (its nullable?!), and getters/setters (I don't want to code gen this away).
Re:Java 16 by lstamour on Wednesday March 17, 2021 @01:36AM (#26486985)
> What do you think is more elegant in Java than C#?

Broad availability of third-party libraries? Java Flight Recorder? IntelliJ? Multiple build system options including first-class support for Bazel, Gradle, and so on. (Msbuild gets old quick...)

That said, personally I prefer TypeScript over all of the above if performance isn't an issue. ;-)

Re:Java 16 by jayd16 on Wednesday March 17, 2021 @04:37AM (#26488010)
We're talking about language design choices not ecosystem.

Even still, libraries are not a problem. Nothing you can't do in C#. You should check out Rider. Bazel and Gradle are cross platform as well.

Flight Recorder is good. I'll give you that. The .NET debugging tools are top notch...on windows. JFR wins out handily until the Linux tools reach parity. Though, again, this is all ecosystem and not language design.

Re:Java 16 by mlk on Wednesday March 17, 2021 @03:12AM (#26487535)
You'd love Kotlin then
Re:Java 16 by LordDragonfang on Tuesday March 16, 2021 @05:21PM (#26483155)
>I don't think C# has been as careful with its abstractions and the general aesthetic of the language to the degree that Java has

You say "careful", others would say "stubborn". The refusal to add things like operator overloading lead to a much less aesthetically pleasing language to read and write.

Re:Java 16 by aardvark179 on Tuesday March 16, 2021 @05:54PM (#26483605)
I can understand the resistance to traditional operator overloading, but something like implementing a Monoid interface which specifies operator methods might work. I think the sort of value types that people are likely to implement with Valhalla will make the case for this much stronger.