7
10Dev
4y

Am I the only one who hates Java but really likes C#?

I don’t know why, they’re basically the same thing, one is basically just a Microsoft clone of the other

Comments
  • 2
    Is it, though?
  • 1
    Same, no idea why
  • 7
    They have similarities, but are significantly different languages when viewed from lowe than 20k feet. I like both of them, C# slightly more.
  • 1
    they're really not "the same thing", at least not in current versions
  • 1
    C# has always been ahead with language features. Java has always been catching up slowly but even now Java is missing some important stuff which C# has. That's why I always liked C# more.
  • 1
    @Lensflare i have never seen C# ahead from language features, not once have I written code in one over the other and said "heck, i wish this had X" the only time has ever actually happened inside of the spectrum of platform rather than language.

    I think the JVM is superior, and to this day Microsoft does not have anything that even comes close in terms of power to something like Scala or Clojure in my opinion. Also, I love the fact that Oracle can say "fuck Scala" and it won't mean shit because we have an entire world of people supporting the language.

    If you like F# and microsoft says fuck it and delegates F# inside something like .net core to just cli apps then good luck building and porting everything you need to a web api baseline (which is currently not the case), but just look at how .net behaved with VB.NET, they said that version 5 would include more support for VB.NET and it is still shit.
  • 0
    there are others, but I ask you "what is the reason?" is the reason fundamentally based on personal preference or technological preference? is it language features or just an idea kept from biases obtained through the internet? e.g "mane java sucks" type of articles written by x douchebag.

    Everyone is entitled to their opinion really, I have never understood platform hate because I believe that everything can be measured through familiarity of a platform. I have heard people bitch about every single tech stack known to man, and I can honestly understand the hate, but most of the time it falls down to "well you could have used <x> to solve your problem" where the other person says "nah fuck it i don't like it" and that is FINE really, but it does not make a platform worse than the other.

    Personally, I prefer the JVM world, .net core is revolutionary in itself, it can run on other platforms and that is dandy, but we've had that shit on the JVM since long before, catch up to that
  • 1
    I like Kotlin (with Gradle) more than C#. Never tried Java 15. I heard it was getting better.

    Also, installing Visual Studio? Not existing on Linux; different versions of macOS.

    I know there is `dotnet` command line on every OS's, though.
  • 2
    They were basically identical when C# launched. But that was a long time ago.

    Since then C# has added features like crazy and Java has been very restrained. I think both have gone to opposite extremes IMHO. Java is way too lean a language (Lombok's existence is proof of that), but C# is now way too big, and realistically almost all projects only ever use a subset of the language features.

    I don't have a strong preference really, so long as you treat Lombok as part of Java these days. I'll use whatever.

    Ideally though - Kotlin. Trumps them both.
  • 3
    @AleCx04 You never missed things like properties, proper generics, value types, async/await, operator overloading, nullability, extensions? I did.

    And of course I was comparing Java and C#. They are both aged compared to what we have now and I know that there are older languages that have some good stuff that is missing in both Java and C#.

    Personally I am a big fan of Kotlin and Swift.
  • 2
    @Lensflare No man I was untouched by those, by means of just sticking to how the general abstractions in Java work, but I can see how those features would be something that one would miss coming from a language that does have said features. I would say, nullability does bite me sometimes and I was always ok with the way generics are handled in Java, for async await functions I never felt it because I started writing "professional"(read as patching or maintaining code) on Java 8 which already included support for lambdas, future and compleatable future. Not as elegant as how c# handles said operations.
  • 3
    @AleCx04
    You're kind of all over the place for the topic >.< They push each other in regards to features, and that's a good thing. Specifically with Java:

    C# language features

    - Language level accessor/mutator syntax (90% of the reason people use lombok, @GetterSetter, @Record, @EqualsAndHashCode)
    - Java doesn't have a good answer to the Task API, even given futures. It drove Java's green thread impl
    - tuples
    - Span/Memory<T>
    - C# made java implement the var keyword
    - And lambda expressions
    - Async await is something the java community wants, to such an extent that flux, spring implement it in effect via aspect
    - Java's answer to pattern matching in C# doesn't exist. C# borrowed it from F#
    - C# won the race to finish Records
    - LINQ forced streams to happen

    VB.Net
    - They never promised extended support for VB.net(https://visualstudiomagazine.com/ar...)
    - This is because almost no one uses it

    ...
  • 2
    @AleCx04

    Dotnet core "cross platform" re: beat that

    - I would say they did at this point. The dotnet VM significantly outperforms the JVM

    Re languages and .Net 5:

    I loves me some scala and clojure, and even Groovy. They're both great languages. I would also add in Graalvm into the discussion. Which is the result of the abject failures that were Rhino and Nashorn, but hey, at least they learned.

    I like Kotlin, but I don't trust it. It's too much of a moving target.

    I've written at length/ad nauseum about the branding trashfire that is .Net 5, so it doesn't bear repeating.

    At the end of the day, the weakest thing about .Net as an ecosystem is the monoglot, silo, NIH mentality of the average dev in that ecosystem. Microsoft has always passed around the koolaid and offer easy buttons. Java will ALWAYS be better in terms of capability in the community. We just have to accept that.
  • 0
    Obviously they are completely different language as much as they look very similar. But there are things that each excels at far more than the other, an example of this is that C# being a . NET language has easier integration with the Windows operating system, specific native calls to the kernel as an example. While Java seems to have achieved its mission of interoperability, specifically by leveraging the underlying JVM some code literally becomes write once write anywhere.

    And all this is not considering the support network behind each ecosystem and ease of setup and long term maintenance
  • 0
    @SortOfTested I don't see how I am all over the place with the topic really, I also don't see where did I claim that they promised that there would be support for VB.NET, I never said they promised it, I said they said something and did not turn out to anything, that very same article claims that there would be more support for it doing different things inside of .net core, which is not true, it still is only class libraries, cli and wow they added a couple of more items into it, but people have been complaining about support for the web platform forever and still nothing, can you honestly tell me that Microsoft is not known for pulling the "nah fuck it, move to this" in terms of technology stacks? FoxPro got killed, classic ASP got killed, VB6 got killed etc etc.

    I know also about the language features and laud Microsoft and in particular C# for them, but they are not a stopping point for me for still preferring the JVM
  • 0
    @SortOfTested I am currently gauging if i can completely eliminate a bunch of the stuff that I have in Python amd convert it to Scala. I really love what i am seeing thus far.

    Specially because my experiment for adding clojure to my workplace did not work at all at how I wanted it ;__;
Add Comment