Being a long-time Java programmer and in recent years a Haskell addict, I am learning Scala now. My question is:
How to program without side-effects in Java ?
i.e. How can I do manually what Scala does for me?
The Scala book from Odersky explains functional concepts in terms of OO-terminology often (e.g. val = final, if = ternary op.).
Is there an accessible guide how to program without side-effects in Java (as few as possible)? I guess one could get many of the known benefits with plain old java and a bit of discipline (e.g. unmodifiable collections, final values, rigid methods that don’t modify object/application state).
See Functional Java.