← Back to context

Comment by vibbix

4 days ago

Java have less of a DevEx score than C# is crazy work.

Reified generics, value types, nullable reference types, LINQ are only some of the things that would give C# an edge in DevEx today.

  • Not sure if it's still the case, but C library interop in C# is the main reason I chose to start with the alpha/beta versions of C# over Java around 2000-2001.

I think devx is being misused in this article a bit. Obviously the tooling for java is second to none, aside from maybe the travesty that is gradle.

What they apparently mean is how "ergonomic"/"expressive" the actual syntax and type systems of those languages are. In that case c# is ahead of java by a decent margin. Luckily java is still evolving, usually by stealing many of the good ideas from other languages like kotlin. But overall those are less language and more runtime features like project looms green threads etc.

  • Java has first class sum types, pattern matching, and compiler exhaustion on types. It's probably far more expressive than C# currently until they get union types.

    • Well, C# has more powerful pattern matching, only compiler exhaustiveness on types is missing today. In Java, sum types (sealed interfaces/classes) require all members to have the same parent, so they can be used only in very narrow cases.

      2 replies →

    • Their sum types aren't particularly useful since they can never be used to implement union types which I believe c# has plans for following their sum types already in preview. So I guess similarly neck and neck.