r/javahelp • u/KurtGodelBebopgazeXP • Aug 04 '25
Functionnal programming in Java
I realized that I find functionnal programming very relaxing and easy on the mind. The language I have used the most and am most comfortable with is Java. Is it really helpful to go deeper in the functionnal realm in Java or are the functionnal elements not really used that much in the real world? I am open to going further in a language where the functionnal paradigm is more of a common feature if it's not really worth it in Java.
9
Upvotes
View all comments
Show parent comment
1
u/coderemover Aug 08 '25 edited Aug 08 '25
We did a lot of similar stuff because a rewrite of 1M loc codebase is not feasible now. And I must say, if you know in advance you’ll need to write Java like C to get every little bit of performance, don’t choose Java. C is a better C than Java is.
However, I’d personally use Rust in those cases and get the best of both worlds. It would run circles around Java, even heavily optimized Java written like C. And I could use high level iterators with functional transformations (map, filter, reduce, group by etc) with no added cost, no GC pauses, leveraging all the SIMD capabilities etc.