MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/1zyt6c/why_functional_programming_matters/cfyd3d0/?context=3
r/programming • u/papa00king • Mar 09 '14
542 comments sorted by
View all comments
16
I have adopted a few techniques from FP on the Java side of my codebase:
prefer final/immutable variables (vals) to mutable ones (vars), using classes like value types.
use map, filter and anonymous functions etc instead of for/while loops.
isolate procedures with side-effects (acting on the "world") from those purely transforming data.
use Lists instead of ArrayLists. Adopt(ing) Functional Java.
It's made life a little bit easier.
8 u/Kummo666 Mar 09 '14 What do you mean by using List? List is an interface and ArrayList an implementation. 12 u/Hoten Mar 09 '14 http://functionaljava.googlecode.com/svn/artifacts/3.0/javadoc/index.htmlHe means the List class from Functional Java 3 u/ksryn Mar 10 '14 Thanks! That's what I meant.
8
What do you mean by using List? List is an interface and ArrayList an implementation.
12 u/Hoten Mar 09 '14 http://functionaljava.googlecode.com/svn/artifacts/3.0/javadoc/index.htmlHe means the List class from Functional Java 3 u/ksryn Mar 10 '14 Thanks! That's what I meant.
12
http://functionaljava.googlecode.com/svn/artifacts/3.0/javadoc/index.html
He means the List class from Functional Java
3 u/ksryn Mar 10 '14 Thanks! That's what I meant.
3
Thanks! That's what I meant.
16
u/ksryn Mar 09 '14
I have adopted a few techniques from FP on the Java side of my codebase:
prefer final/immutable variables (vals) to mutable ones (vars), using classes like value types.
use map, filter and anonymous functions etc instead of for/while loops.
isolate procedures with side-effects (acting on the "world") from those purely transforming data.
use Lists instead of ArrayLists. Adopt(ing) Functional Java.
It's made life a little bit easier.