3 ms·
Just want to add some defense for OOP (and that the two is not orthogonal at all, you can do OOP with FP): not everything is data-first. There are cases where o
by kaba0 5y ago
Just want to add some defense for OOP (and that the two is not orthogonal at all, you can do OOP with FP): not everything is data-first. There are cases where object identity is essential for example, as well as types where the internal state has to be truly encapsulated to uphold invariants. Here, most FP languages would use the convention to only use functions designed explicitly for that very finicky use-case, while OOP can enforce it.
- choeger 5y agoFor the latter case you would use an abstract type hidden in some module in ML. Only difference to OOP is the lack of open recursion and implicit "this" argument.