Object-Oriented Programming is Garbage: 3800 SLOC example [video]
While I&#x27;m sure the topic (and title) may be seen as hostile, this is a very nice code walkthrough and discussion.<p>The arguments against OOP seem to be 1) OOP obscures data structures by hiding them in too many data types, and 2) the boundaries created by these data types forces workarounds like extra fields to hold a root structure pointer even though it isn&#x27;t part of the type.<p>OOP - <i>in practice</i> - does tend to encourage far too many types. A lot of these types are often represent code or design decisions, not the actual data. Instead of a &quot;few&quot; structs that clearly show how the data is organized, we tend to see OOP code that has the data structure spread out over various classes, interleaved with types that actually represent different actions (with the same data).<p>The solution I always try to keep in mind is that OOP can be useful <i>if-and-only-if</i> the data actually has a hierarchy. A single standalone class is equivalent to a basic struct passed to functions. The class only becomes worthwhile when are able to use polymorphism that closely model the data. The serious problems start when you try to force <i>everything</i> into a class; in extreme cases you end up with the Kingdom of Nouns[1]<p>The second argument seems to follow from the first; if you have too many types, you tend to take shortcuts like keeping a local reference to a parent or global object that is really outside your scope. This tight coupling creates maintenance problems and further confuses what the type is actually representing.<p>[1] <a href="http:&#x2F;&#x2F;steve-yegge.blogspot.com&#x2F;2006&#x2F;03&#x2F;execution-in-kingdom-of-nouns.html" rel="nofollow">http:&#x2F;&#x2F;steve-yegge.blogspot.com&#x2F;2006&#x2F;03&#x2F;execution-in-kingdom...</a>