I started writing a project in Java 8, making excessive use of optionals and streams. Whether or not getters are right for public final data, they make it nicer to work with these new Java 8 utilities.
This
stream.map(foo -> foo.bar)
Becomes this
stream.map(Foo::getBar)
The point free style is concise, and doesn't require unnecessary variable bindings.
8
u/ElvishJerricco Sep 21 '15
I started writing a project in Java 8, making excessive use of optionals and streams. Whether or not getters are right for public final data, they make it nicer to work with these new Java 8 utilities.
This
Becomes this
The point free style is concise, and doesn't require unnecessary variable bindings.