Your essay is arguing against a strawman of what "good" OOP is supposed to be. Your examples...<p><i>>Objects just aren't supposed to be reaching into each other with 'getters' and 'setters' and messing with information. </i><p>The getX() and setX() is an <i>anti-pattern</i> of good OOP.<p><i>>Instead of using objects for compartmentalizing functionality, they were just used as a holding pen for loosely related functions. </i><p>No, good OOP has class/object with <i>both</i> private state and associated functions combined to provide a <i>public interface</i> for clients to use.<p>(Although Java & C# (unlike C++) may have muddled this aspect because their language specification does not allow "free" functions to live in a plain namespace. Therefore, programmers are forced to use the "class{}" keyword with static functions as a workaround. Maybe that's where your "holding pen" characterization came from?)<p><i>>A traditional OOP approach uses shadowy architecture to remove the responsibility of an object,</i><p>No, good OOP tries to <i>push responsibility</i> into classes/objects so they can act as independent agents with minimal coupling to the outer context they sit in.<p>I'm guessing your comments are based on seeing a lot of poor practices masquerading as OOP which affects what you think OOP actually is. Unfortunately, it's like trying to argue against Javascript because of overuse of "eval()" or arguing the flaws of Haskell because variable names are often 1 character long.<p>There are definitely problems with OOP but they are not the bullet points you mentioned.
The OOP referred to in this article is certainly a straw man, but the alternative suggested has problems too.<p>Teams that work well act almost like they're mind-reading one another. High quality orchestration of disparate parts is in tension with encapsulation.<p>Actor-based programming is highly concurrent but in my experience it's harder to reason about as it scales up. Emergent behaviour of interactions between hidden states is sometimes the goal, and sometimes an unwanted side-effect. Network protocols are tricky to get right for a reason; splitting everything out into a shared-nothing message-passing architecture isn't a panacea.<p>I lean more towards explicit but immutable data structures, and referentially transparent functions over those data structures. In this world, parallelism can increase performance without observable concurrency. Concurrency is the root of non-determinism; non-determinism should be avoided unless it's inherent to the problem at hand.<p>OOP is a middle ground in this world, but it's ill-defined. Depending on style, it can be stateful and imperative, functional or message-oriented. OOP is not an absolute bad; with effort, it can be massaged, or herded, into working patterns. But it's certainly not a universal optimum.
<i>A traditional OOP approach would have much of the functionality taken out of the player objects, using them simply to hold state. </i><p>I don't agree with that characterization. The author certainly has a point that, in some languages in particular, like java, there tend to be massive over-decomposition of problems into reams of factories, controllers, controller factories and controller factory manager factories, but that isn't OOP, that's due to cultural and syntactic issues with those languages. (I know, I know, No True Scotsman.)<p>In the Rails world, which is a non-trivial component of the broader OOP software world, there is a saying: "Fat Model, Skinny Controller" which is much more in the spirit of what the author is advocating, despite remaining OOP.<p>Again, this isn't to deny the authors general point, but I don't believe it is bound to OOP, so much as it is to a certain style of OOP coding that arose from early (java in particular) over-engineering and excessive decomposition.
Joe Armstrong's thoughts on how Erlang is more OO than OO languages:<p><a href="http://erlang.org/pipermail/erlang-questions/2009-November/047748.html" rel="nofollow">http://erlang.org/pipermail/erlang-questions/2009-November/0...</a><p>Joe likes to be funny, so don't get upset and confrontational about it.<p>The central idea is this I think:<p>---<p>I now believe the following to be central to the notion of OO.<p><pre><code> - Isolated concurrent things
- Communication through message passing
- Polymorphism
</code></pre>
All the other stuff (inheritance, private/public methods, ....) has
nothing to do with OO.<p>---
>> When I started learning C++ I was shocked. Instead of using objects for compartmentalizing functionality, they were just used as a holding pen for loosely related functions. Instead of communicating between themselves, objects were operated on by some bigger parent object. I found it absurd and fought it for a long time.<p>This has nothing whatsoever to do with C++. It's like blaming a microwave oven because your kid put a ball of tin foil in it.<p>C++ is a great language when you are developing big compiled programs and need strong metaphors for decoupling and modularity. Most developers today work on distributed systems where the individual cooperating pieces that they write are much smaller. Your 1000 line HTTP handler in python won't benefit much from strong static type checking, but the linux kernel does, and so do a lot of the infrastructure components we all take for granted every day.
One of the more ironic titles I've seen.<p>Alan Kay (progenitor of Smalltalk and OOP) has said on various occasions that it should have been called message-oriented programming, rather than object-oriented.<p>"I'm sorry that I long ago coined the term 'objects' for this topic because it gets many people to focus on the lesser idea. The big idea is 'messaging'"<p><a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/1998-October/017019.html" rel="nofollow">http://lists.squeakfoundation.org/pipermail/squeak-dev/1998-...</a>
The same thing happened with REST, TDD and Microservices, etc. The term gets hijacked by people that are less than skilled at executing it. And unfortunately there are more unskilled than skilled people in software; so usually the hijacked term wins the contest. It then takes decades of the "original guy" sending out a BBS message / IRC message / vBulletin post / Blog post / Tweet / HN comment / etc to try to correct people's understanding by saying "actually, that's not canon!".
Comment on the code:<p>As a Lua aficionado I hate to see stuff like this:<p><pre><code> Ball = {}
Ball.__index = Ball
function Ball.new (x, y)
local table = {}
setmetatable(table, Ball)
table.x = x
table.y = y
return table
end
</code></pre>
Explicit setmetatable() call and manual __index setting? You can automate this and hide all the metatable magic = less code to write, less potential for bugs.<p>E.g. in my own Lua object system the above would be:<p><pre><code> Ball = Class()
function Ball:Properties(x, y)
return { x = x, y = y }
end</code></pre>
I think that we suffer from a paucity of precise language around OOP. Everything is OOP, everything is what Kay created, etc.<p>But that's clearly not the case, and so people have these radically divergent systems of programming within the framework of "object orientation".<p>My read of this article and it is very message-passing OO to me. Its broadcast mechanism is interesting, for sure. But it reads a lot like Erlang's supervision tree without all that troublesome thinking about a network.<p>But it's approach is still very "OO".
<i>> Objects just aren't supposed to be reaching into each other with 'getters' and 'setters' and messing with information.</i><p>In pure Actor Model adding two numbers would probably involve 2+ actors, yet Erlang is not doing this for some reason... I guess on a lower level hardcoding messages makes complete practical sense.
Some meta feedback on the article: this font is too big to comfortably read on mobile, fitting about five to seven words on a line (the typically recommended line length is about 14 words).
The less actual code I see in articles like this, and the more abstraction I read about, the less I take the concept seriously.<p>In fact, all of this seems like bullshit to me. The actual code inside of the repo is, well, object-oriented. How I interpret this is that the author seems to have no idea what they're even talking about, and that they write more about code than they write code itself.<p>Show me what you mean, don't just talk about it.
The more I read about functional programming the more I question why are things this hard in traditional oops. If so many people have been doing oops for so many years then it must have something that is easy to pick up or something that is easier to work with. But after doing some functional programming the number of lines are painfully less and the code is easier to understand. I was thinking may be I was giving too much credit to FP but I was not it's simply just the way things are. But why has FN been used only as an academic tool and not as a goto programming paradigm? Can someone shed some light on this?