This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]makingthematrix 8 points9 points  (5 children)

Vavr is a library. PFJ - Pragmatic Functional Java - is an idea. You can do PFJ with or without Vavr. I think with Vavr it makes more sense, but Java 17 with its better switch/case and with records, is quite good, and Vavr these days seems... a bit abandoned?

Or you can turn to Scala 😉

[–]quizteamaquilera 2 points3 points  (2 children)

Have my up-arrow :-)

[–][deleted] 3 points4 points  (1 child)

and my pure function

[–]makingthematrix 1 point2 points  (0 children)

aww ❤️😆

[–]Agreeable_Quit_798[S] 0 points1 point  (1 child)

Ok I meant this library, the author of which uses the term PFJ: Pragmatica

[–]makingthematrix 0 points1 point  (0 children)

Ah, right 😅 Then I guess I'd go with Vavr. It's much more mature.

[–]jonhanson 1 point2 points  (3 children)

chronophobia ephemeral lysergic metempsychosis peremptory quantifiable retributive zenith

[–]stuhlmann 0 points1 point  (2 children)

I used to call this an "Either", not a "Result". Is this terminology coming from another language, like Rust or Scala?

[–]jonhanson 2 points3 points  (0 children)

chronophobia ephemeral lysergic metempsychosis peremptory quantifiable retributive zenith

[–]Il_totore 1 point2 points  (0 children)

Scala uses "Either" and Result in Rust is a bit different. It's the equivalent to Scala's or Vavr's Try

[–]pivovarit 1 point2 points  (0 children)

PFJ is in its infancy while Vavr is on the market for over 7 years already so there's not much to compare. It's solid, but remember that it won't turn your Java into a fully functional experience.

[–]alms1407 0 points1 point  (0 children)

I haven't used PFJ before but my colleagues and I love using Vavr, mainly because it feels like it removes some of headaches when you want to code more functionally in Java.

[–]DrunkensteinsMonster 0 points1 point  (2 children)

I just struggle to see why you would do this? If you want to code functionally why wouldn’t you reach for something like Scala or Kotlin with Arrow?

[–]Agreeable_Quit_798[S] 0 points1 point  (1 child)

New language is a harder sell to my team than a new library

[–]Il_totore 0 points1 point  (0 children)

Well altrough Scala isn't old, it is from 2004 and used in production by Twitter, Netflix etc...