Why OO Sucks by Joe Armstrong (2000)
I&#x27;ve said this multiple times over multiple years and I&#x27;ll say it again just because so many green developers get misled.<p>Object oriented programming is good. Not in absolutely every situation, but for most business applications it&#x27;s better than the alternatives. The reason it&#x27;s good is that it is productive. Objects map neatly to records, which pushes global state persistence and all the hairiness of locks to a good RDMS like Postgres. It&#x27;s naturally normalized, but can be denormalized without much work, and in exchange for bundling state with functions you get easier introspection which is especially helpful in debugging.<p>These conversations are better done with examples. Say you want to build a social network around videos, like YouTube. Say a user can block another user and, thus, stop them from commenting on their videos.<p>Would you rather type out this:<p><pre><code>    user.blocked_by? other_user
</code></pre>
Or this<p><pre><code>    is_blocked(user, other_user)
</code></pre>
When doing the check? Personally, seeing the the is_blocked? method on a user makes it easy for me to understand. Who has blocked whom is more natural to talk about when there is a primary object subjecting the other object to a test. For all the anti-OO stuff out there, it all boils down to the same thing in the end. For business logic, your functions need to know so much about the data that they are operating on that it&#x27;s pointless to try to avoid bundling the state. I&#x27;m never going to pass a cheeseburger into my is_blocked function so why on earth would I avoid bundling state and operation together? It&#x27;s like a map of a city trying to avoid listing shops since &quot;maps should be about roads and geography, not shops.&quot; A pointless dogma that doesn&#x27;t actually help programs get built. Most successful startups use OOP and there is a clear reason for that: It&#x27;s more productive.<p>Now, do I use OOP when I&#x27;m doing data science stuff? Mostly no. I don&#x27;t need it there. But where it works, it&#x27;s magic.