Hacker News new | ask | show | jobs
by serichsen 3344 days ago
Valid points, but not _the_ point. There is a big difference between allowing and supporting something.

OO languages _support_ hidden inputs and outputs as well as programming by mutation. They _allow_ programming in a functional style, but you will have to be inventive for it.

FP languages _support_ immutable values, referential transparency and all that. They _allow_ programming by mutation and hidden inputs and outputs, but you will have to be (sometimes very) inventive for it.

2 comments

Exactly. Starting points matter. And for me, a starting point of "enforces immutable data" is a good one.
Starting points matter, but this depends on the programming situation. That's why you use OOP or FP where it is most appropriate or suitable. Neither OOP nor FP is a panacea. Neither OOP nor FP is the universal programming tool.
Nothing prevents an object's methods from being referentially transparent. It just depends on how you choose to write them.