4 ms·
> OOP is the most popular paradigm because it works the best for the greatest number of people and projects It's a novice mistake to think the solution that wi
by naasking 9y ago
> OOP is the most popular paradigm because it works the best for the greatest number of people and projects
It's a novice mistake to think the solution that wins out is the one with the most technical merit. Virtually nothing is truly meritocratic.
> It's natural to break large systems into component parts recursively, and to let components have their own state.
That's just modularity. Nearly every language has it, and OOP is merely one way to achieve it.
- seanmcdirmid 9y agoWhat other paradigm focuses on components with encapsulated state? Definitely not functional! Isn't any nounish "thing" with state an object anyways? Why else could it be?
- di4na 9y agoBecause there are no "nounish" things. It is a false construct. Also see Actor model or "out of the tarpit". Also Barbara Liskov "Programming with Abstract Data Type". Encapsulating state instead of behaviours is a mistake.
- seanmcdirmid 9y agoHewitt never said actors weren't objects, quite the opposite actually. Heck, simula (the first OOP language) objects were very actor like. Grand parent is talking specifically about encapsulating state and not just behaviors.
- di4na 9y agoSimula objects were not a Actor like, they were exactly like today object. Smalltalk originally was like Actors, and it is what spawned the idea in Hewitt mind. Our Objects of today come straight from Simula. Edit : and yes, there is a reason i said behaviour and not state. Objects are bad at encapsulating state, because you do not encapsulate state like that.
- seanmcdirmid 9y agoSimula objects ran as coroutines.
- willtim 9y agoContrary to popular belief, OOP doesn't really encapsulate state, it just hides it. Encapsulated state should mean state that does not contribute to the global state space of the system. The danger of OOP is that one ends up with a combinatorial explosion of possible states your system may be in. This may be desired in some situations (e.g. simulations) but does not make a good general approach. Note that functional languages are also capable of building stateful systems this way, for example Erlang actors or composing finate-state automata.
- naasking 9y ago1. You don't want components with encapsulated state at every level of your system. 2. Where you do want them, like at coarser service boundaries, virtually all general purpose languages have modules of some sort.
- seanmcdirmid 9y ago1. Sure, most system are not made purely out of functions or purely out of objects. 2. If a module has state, is it not named with a noun, is not an object even if we try calling it an entity, an actor, or anything else?
- naasking 9y ago> If a module has state, is it not named with a noun, is not an object even if we try calling it an entity, an actor, or anything else? But we're talking about OOP, which is characterized by specific logical properties surrounding modelling, encapsulation and extension, not about colloquial terms like "objects" that are referred to by nouns. Conflating colloquial language with the programming language is one of many reasons why OOP seems seductive but is often misleading.
- tome 9y agoMy current hypothesis on OOP[1] is that it because popular simply because it was the easiest way to get GUIs to work. I don't see any other critical reason for its rise. [1] And I could have tested this hypothesis by doing more background reading of the history, but I haven't.
- naasking 9y ago> My current hypothesis on OOP[1] is that it because popular simply because it was the easiest way to get GUIs to work. Not sure it was the easiest way (see IMGUI), but I agree with you that some early UI frameworks took that approach and it was probably so much better than what came before it, that OOP is still riding that wave of enthusiasm.