• TehPers@beehaw.org
    link
    fedilink
    English
    arrow-up
    4
    ·
    20 hours ago

    C# is what you get when someone looks at Java and says “but what if we actually added functional programming elements to it instead of forcing the OOP Kool-Aid on all our users?”

    It’s full of random functional features spanning from pattern matching to discriminated union types. It also has a lot of really random stuff that nobody asked for, like LINQ syntax.

    On the other hand, Java took a different approach. They were so insistent on forcing OOP on their users that the users made a rich ecosystem of functional languages on the JVM out of spite, like Scala, Kotlin, and Groovy.

    These days, Java has been a bit more progressive with their feature set, but C# is far better if you’re looking for functional features.

    • YaBoyMax@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      14 hours ago

      C# is what you get when someone looks at Java and says “but what if we actually added functional programming elements to it instead of forcing the OOP Kool-Aid on all our users?”

      Java has had lambdas and functional APIs for over a decade now, since Java 8.

      • Zarobi@aussie.zone
        link
        fedilink
        English
        arrow-up
        3
        ·
        8 hours ago

        Why does writing Java code still feel like rolling my own wheelchair uphill both ways with a broken arm then?

      • TehPers@beehaw.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        13 hours ago

        There’s more to functional programming than lambdas. Even C++ has closures, but that doesn’t make C++ a functional language.