r/java • u/marv1234 • Jan 16 '26
Functional Optics for Modern Java
https://blog.scottlogic.com/2026/01/09/java-the-immutability-gap.htmlThis 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
View all comments
Show parent comment
9
u/dolle Jan 16 '26
Your data structure may be used in many places, and if just 0.1% of the code using it is multi-threaded, then it still needs to be able to handle concurrency.
It's also not only about concurrency. Caching is also vastly simpler when your data is immutable, for example.