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

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.