4 ms·
The trouble with OOP is that objects you can send messages to are already too complex to reason about. You can't send the same message twice and expect to get t
by lmm 8y ago
The trouble with OOP is that objects you can send messages to are already too complex to reason about. You can't send the same message twice and expect to get the same reply (or even, in some implementations, get a reply at all). So the fact that you can implement anything with objects isn't that surprising, because saying something is an object doesn't really constrain what it can do - you might as well say you can implement anything with a "thing", which is true but useless. Functions - or rather, constructive, well-typed functions - occupy a nice sweet spot where they're constrained enough to reason about, but powerful enough to do what you need.
https://tahoe-lafs.org/~davidsarah/noether-friam4.pdf https://tahoe-lafs.org/~davidsarah/noether-friam4.pdf has a more concrete set of tradeoffs: starting from a small, highly symmetric core, you add more capabilities to the language but you break a symmetry each time. One of the levels in the rainbow is an OOP language, but that requires breaking enough symmetries that I wouldn't want to work in it if I could avoid it.