• masterspace@lemmy.ca
    link
    fedilink
    English
    arrow-up
    24
    ·
    edit-2
    2 months ago

    C# is just flat out objectively a better language, in virtually every single way

      • masterspace@lemmy.ca
        link
        fedilink
        English
        arrow-up
        7
        ·
        2 months ago

        I’m not talking ecosystem or which I’d choose to build an actual project with, just on a pure language basis, C#'s typing system is more flexible and less verbose than Java’s, and unlike Java, C# actually treats functional programming as first class.

        Java has certainly gotten better in both regards, but C# was really just a joy in comparison.

      • tias@discuss.tchncs.de
        link
        fedilink
        arrow-up
        5
        ·
        edit-2
        2 months ago

        Well it’s always about finding a good balance isn’t it. Too many features like in C++ has negative consequences. Preferably you want something that lets you do all that you need to do, but not more. The trick to designing a good language is to let developers achieve as much as possible with as few features as possible, while keeping the code easy to reason about and understand.

        This is obviously both subjective and highly dependent on what problem you are trying to solve, but I can’t think of any situation in my career where C# would not have been a better a choice than Java from a strictly technical perspective. It’s not just that the C# language is better, it’s that the Java ecosystem is founded on poor design choices that result in code bloat and implicit behavior that is hard to troubleshoot and secure. See e.g. Spring, which automatically picks up and loads any logging library that happens to be in the user’s path, even if that is an exploitable version of log4J. Java has become corrupted by enterprise architects. This satirical project demonstrates what I mean.

        I say this as someone who is currently developing a FOSS Java library in my spare time, out of frustration with the Java code I had to endure at work.

        • MyNameIsRichard@lemmy.ml
          link
          fedilink
          arrow-up
          2
          ·
          2 months ago

          I dare say that you could replicate the same mess in C#, PHP, Python, C++, or any other object oriented language. Just because people write bad code, it doesn’t mean the language is bad.

          • tias@discuss.tchncs.de
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            2 months ago

            Sure, I didn’t claim that the bad ecosystem makes the language as such bad (although it is still bad, for other reasons). It’s just an additional disadvantage of developing software on the Java platform.

            That said, I do think some of the bad code out there is an effect of trying to work around flaws or missing features in the language. Libraries like Spring add an additional configuration layer that is practically like an additional language on top of the base language. Instead of coding Java, you’re coding Bean configurations and filter chains. Unfortunately all of that comes without useful debugging tools, so you’re left scratching your head why the system isn’t doing what you want. Log4J is another such complex configuration system that - unfortunately - customers are encouraged to change themselves which leads to confusing failure modes and insufficient user interfaces.

      • ThirdConsul@lemmy.ml
        link
        fedilink
        arrow-up
        4
        ·
        2 months ago

        Out of curiosity, could you give me an example? I usually think the opposite whenever I interact with other languages?

          • ThirdConsul@lemmy.ml
            link
            fedilink
            arrow-up
            2
            ·
            edit-2
            2 months ago

            C# covers all feature of functional programming that comes to mind from Go (edit: not Go, what was it, Haskell?).

            Traits? Done. Monads? Done. Functions as params? Sure. Closures, errors as values, whatever you want.

            What are the specific language features you’re looking for or think are missing in C#?

    • m532@lemmygrad.ml
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      2 months ago

      Wrong its by microshit that makes it worse

      Also java is better designed

      Also java doesnt have builtin sql like shit, I hate SQL

      Also java has intellij

      C#s capitalization scheme is also stupid

    • turnip@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 months ago

      I don’t understand why any VM language is widely used. Running on every OS makes no sense to me when you could just compile it for other OS, was there some other reason?

      • pinball_wizard@lemmy.zip
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

        was there some other reason?

        Compiling to an additional OS, today, can be a pain in the ass.

        Compiling to an additional OS, a couple decades ago, was a monumental ongoing never ending pain in the ass.