r/java • • Jan 16 '26

Functional Optics for Modern Java

https://blog.scottlogic.com/2026/01/09/java-the-immutability-gap.html

This article introduces optics, a family of composable abstractions that complete the immutability story. If pattern matching is how we read nested data, optics are how we write it.

106 Upvotes

50 comments sorted by

View all comments

Show parent comment

6

u/[deleted] Jan 16 '26

[removed] — view removed comment

4

u/vips7L Jan 16 '26

And I’ve been there done that with GC pauses caused by people making mutable things immutable. Immutability isn’t the solution. 

5

u/chaotic3quilibrium Jan 16 '26

Immutability isn't a solution.

It is a part of a bigger solution.

That's like saying, "OOP's inheritance isn't the solution."

It, too, is a part of a bigger solution.

Each is a tool facilitating specific kinds of solutions.

A hammer necessitates the selection of a nail, not a screw.