I have heard this time and again, and I am trying to understand and validate the idea that FP and OO are orthogonal.
First of all, what does it mean for 2 concepts to be orthogonal?
FP encourages immutability and purity as much as possible, while OO seems built for state and mutation – a slightly organized version of imperative programming? I realize that objects can be immutable, but OO seems to imply state/change to me.
They seem like opposites. How does that affect their orthogonality?
A language like Scala makes it easy to do OO and FP both, does this affect the orthogonality of the two methods?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…