4 ms·
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
by cmckn 6y ago
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! :)
- LordDragonfang 6y ago>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.
- aardvark179 6y agoI 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.
- sproketboy 6y agoBrian has already said that a static set of operators for classes extending Number is on the roadmap. That's all that's required. Arbitrary operator overloading is a terrible idea.
- jayd16 6y agoWhat 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).
- lstamour 6y ago> 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. ;-)
- mlk 6y agoYou'd love Kotlin then
- jayd16 6y agoWe'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.