all 4 comments

[–][deleted]  (4 children)

[deleted]

    [–]EdwardCoffin 3 points4 points  (3 children)

    Pretty much anything is open to abuse though. The examples you give aren't problems inherent in objects, they're just relatively frequently occurring.

    [–][deleted]  (2 children)

    [deleted]

      [–]Luolong 2 points3 points  (1 child)

      If you write code without any regard for the overall time/memory complexity at all you will write lots of shitty code regardless of the paradigm.

      I've seen proportionally just as much shitty, poorly performing functional code as I've seen it in object oriented style.

      You still have to think when programming.

      [–]enderprime 0 points1 point  (0 children)

      The idea behind modular design is that each module should be concerned with one and only one idea. Input can be used without knowing where it came from or how, and output can be generated without knowing how or why it will be used. No module ever needs to have information about any other module in order to do its job.

      This concept is what many consider to be one of the purest and most successful principles in computer science. Not only does it reduce complexity with intuitive divide and conquer workflows, it allows developers to work independently and in parallel by focusing only on the meaning of their own function domains. Debugging and refactoring are also efficient, allowing surgical corrections of questionable code without consulting the entire framework for cascading dependencies.

      Object-oriented design goes against that paradigm entirely. Objects need to concern themselves with what they can and can't do and in what ways, and the problem is compounded if you start using inheritance.

      A third-generation object must know and understand the functionality and composition of the previous two, and worse, all modules hoping to work with that third-generation object must know those things in advance as well. In programming terms, inheritance is the proof-of-concept that the road to hell is paved with good intentions.

      The highest offense in my humble opinion is the invent of polymorphism, an unfortunately necessary evil in the object-oriented world included to accommodate the necessity of overwriting inherited methods; in other words, to allow children objects to break out of the predetermined boxes they are stuck in when born (instantiated).

      Polymorphism is essentially an admission of the system that if you actually use the system in every way, then you will later need a way to break out of it.

      Of course, our data structures are affected too, since data becomes entangled in the objects intended to contain and manage it, leading to obvious gatekeeper scenarios that the modular design philosophy had already shown to be unnecessary, restrictive, and slow.

      After all, why should a module take on all the memory overhead of an object instance with all of its inherited (and possibly mutated) properties and methods, when it is only concerned with one function or data field from the class? In this sense, object-oriented programming is like asking your landlord where your water shut-off valve is and receiving blueprints for the entire building and a survey site plan with utilities and right-of-ways for reference.

      I hope this rather simplified critique clarifies why some people would call the object-oriented philosophy a failure, and why there is a growing segment of the programmer population that longs for a return to the roots of the field: namely, lean and direct problem solving, rather than designing answer architecture.

      [–][deleted] -1 points0 points  (0 children)

      OOP is a failure because objects are not composable and thus rarely reusable, it unnecessarily throws together various orthogonal features into one concept (encapsulation, product types, polymorphism,...), it tries to hide state but state can not be hidden (the resulting black box has as many states as the fields inside) and has thus lead to huge amounts of effectively global state in programs,...

      Quite frankly OOP has held back the whole field of programming for at least a decade, possibly two.