|
|
|
|
|
by sjrd
2050 days ago
|
|
Your comment makes sense if we think of FP as being about "function values". In a world where all sorts of programming languages have function values, this is not a strong enough characterization anymore (if it ever truly was). Functional programming is about programming with immutability first. So OOFP is about immutable objects. I go even further to say it is about objects with immutable interfaces, but the implementations can be imperative as long as encapsulation hides the mutable aspects from the user of the object. This is what you see in Scala's collections library: we use mutability inside the implementation but we expose an immutable API. I gave an entire talk on that very topic at Scala Italy in 2019: https://vimeo.com/362001027 |
|
I completely agree with this. So perhaps I am being rather hard on Scala.