• passepartout@feddit.orgOP
    link
    fedilink
    arrow-up
    17
    ·
    10 hours ago

    Functional programming in Java is kind of an afterthought and it shows. That’s one of the reasons why Scala was created!

      • marcos@lemmy.world
        link
        fedilink
        arrow-up
        6
        arrow-down
        2
        ·
        4 hours ago

        Just let C++ die already, and stop pretending it’s a reasonable thing to compare other languages with.

        If you can’t do it in C, you are better in Java, Python, Haskell, whatever.

    • potatoguy@lemmy.eco.br
      link
      fedilink
      arrow-up
      7
      ·
      10 hours ago

      Yeah, Scala is the GOAT, but while I can’t use, why not final everything, use 300 streams and pass Suppliers around?

      (I’m building a lot of libraries at work)

      • silasmariner@programming.dev
        link
        fedilink
        arrow-up
        4
        ·
        4 hours ago

        Do people still use vavr? When I wasn’t allowed to use scala that made up for a fair few shortcomings but it’s probably less relevant than it used to be

        • potatoguy@lemmy.eco.br
          link
          fedilink
          arrow-up
          4
          ·
          edit-2
          4 hours ago

          I didn’t know about vavr, I think a lot of things from it were added since Java 17, but this Try<T> seems cool.

          Edit: Either would be nice too. I’m going to test some of those things, thanks for the recommendation!

          • silasmariner@programming.dev
            link
            fedilink
            arrow-up
            4
            ·
            3 hours ago

            Very pleased to have been of help! I love scala but Java really isn’t too bad (streams API is fine except that you need to explicitly move in and out, rather than getting to do the cool scala thing of just using methods in the phenomenal collections library) and I don’t like dunking on it, but it really does need a few helper libs. Tuples, either and try I think vavr has. Java seems to have covered most other stuff now. But been a half decade since I’ve written more than 10 lines at a time so hasn’t come up for a while. Sorry. Reminiscing. Sunday night blues.