| ▲ | prewett 5 hours ago | ||||||||||||||||||||||
It's unclear to me what the author thinks OOP is, and what he thinks we are replacing it with. The main point of OOP to me is hiding internal state. So OOP is great for user-interface, because there's all kinds of state there (not just the model, but the internal state of the UI element, like the scroll position of a list or the selection range of a text edit). Microservices, in fact, could be considered "network objects" and a microservice framework as network OOP. The problem there is that normal making a function call is straight-forward. The call produce a failure result, but the call actually happens. On the network, the call might not happen, and you might not be aware that the call cannot and will not happen for some seconds. This is not likely to simplify your code... OOP can be just about structuring code, like the Java OOP fundamentalism, where even a function must be a Runnable object (unless it's changed since Oracle took over). If there's anything that is not an object, it's a function! Some things are not well-suited to OOP, like linear processing of information in a server. I suspect this is where the FP excitement came from. In transforming information and passing it around, no state is needed or wanted, and immutability is helpful. FP in a UI or a game is not so fun (witness all the hooks in React, which in anything complicated is difficult to follow), since both of those require considerable internal state. Algorithms are a sort of middle ground. Some algorithms require keeping track of a bunch of things, others more or less just transform the inputs. OOP (internal to the algorithm) can make the former much clearer, while it is unhelpful for that latter. | |||||||||||||||||||||||
| ▲ | hackthemack 5 hours ago | parent | next [-] | ||||||||||||||||||||||
> It's unclear to me what the author thinks OOP is I rather liked the old post "Object Oriented Programming is an Expensive Disaster that Must End" written over 10 years ago. https://medium.com/@jacobfriedman/object-oriented-programmin... Many complained the post was too long, and then debated all kinds of things brought up in the article (such is the way of the internet). But the one thing I really liked is how it laid out that everyone has a different definition of what OOP is and so it is difficult to talk about. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | senderista 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
The essence of OOP to me is message-passing, which implies (hidden) local mutable state (there must be local state if a message can change future behavior). (Really, actor-based languages are purer expressions of this ideal than conventional OOP languages, including Smalltalk.) However, encapsulation is not at all unique to OOP; e.g. abstract data types are fully encapsulated but do not require all function calls to look like message passing. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | gwbas1c 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
> It's unclear to me what the author thinks OOP is, and what he thinks we are replacing it with. The author is complaining about bloat. The thing is, in this case, the bloat has highly tangible costs: Spreading an application across multiple computers unnecessarily adds both operation costs and development costs. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | deepsun 3 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
> If there's anything that is not an object, it's a function! Why, functions have state -- their closure. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | airstrike 2 hours ago | parent | prev [-] | ||||||||||||||||||||||
> So OOP is great for user-interface, because there's all kinds of state there (not just the model, but the internal state of the UI element, like the scroll position of a list or the selection range of a text edit). OOP is not better suited for user-interfaces than the alternatives. | |||||||||||||||||||||||