3 ms·
Sounds like you discovered that OOP and Functional are the same thing. Closures are the poor-person's objects. Objects are the poor person's Closures. If you ne
by virmundi 8y ago
Sounds like you discovered that OOP and Functional are the same thing. Closures are the poor-person's objects. Objects are the poor person's Closures. If you never mutate the internals of an Object, or mutate with copy, isn't just a coherent closure?
Checkout http://wiki.c2.com/?ClosuresAndObjectsAreEquivalent http://wiki.c2.com/?ClosuresAndObjectsAreEquivalent
- shackenberg 8y agoIf they are the same thing, why does the parent commenter prefer Functional?
- virmundi 8y agoPersonal choice. Some people like the idea of splitting the data from the functions that operate on it. Others don't like mutability and presume that OOP requires it. Scala and other languages make it easy to have immutability and OOP. Look at Clojure. The interfaces look a lot like Object definitions.