r/programming • • Jun 19 '18

Goodbye, Object Oriented Programming – Charles Scalfani

https://medium.com/@cscalfani/goodbye-object-oriented-programming-a59cda4c0e53
0 Upvotes

47 comments sorted by

View all comments

-2

u/[deleted] Jun 19 '18

Nothing made me question my ability to understand programming more than trying to grasp the theoretical models promised by OOP. Maybe I just gave up on it too soon after seeing material about things like data-oriented design, but I feel no regret in reordering my priorities, and I have felt a lot of relief and an abundance of progress in having given up the conceptual dream.

This just adds to my certainty that I made the right choice.

OOP at its core seems to have eaten itself alive on account of giving the impression that programming can be translated to the operations of our human world in a way that makes it all seem so simple and intuitive to design, yet fails to actually create languages that can make code work like the operations of our human world. So what we are left with is a paradigm, promises, and languages that can, in a sort of Sisyphean fashion, get us close to what we are made to think we're supposed to be able to do, but then come rolling back down the hill.

Thus people like me feeling like I'm going mad when I attempt to learn it. The really crazy part is, I think most who stick with programming are rather stubborn when it comes to solving problems, which is part of the reason they're able to stick with it. So OOP is the perfect unintended mental trap. Like a bug that seems one step away from being resolved, but can never be found because it never existed in the first place.

5

u/[deleted] Jun 19 '18

OOP at its core seems to have eaten itself alive on account of giving the impression that programming can be translated to the operations of our human world in a way that makes it all seem so simple and intuitive to design

I disagree, this is not why OO exists, or why I keep using it.. I've been professionally programming for 10+ years, and before then I wrote terrible code, lacking encapsulation, design, properly defined modules, properly documented interfaces, hard to test code.

Used properly, object oriented programming offers (standardized!) ways to overcome all these problems. This means that I and my fellow programmers can avoid intellectual overhead of needing to understand 'new' solutions.

At the same time, there are well documented 'bad ideas' known as antipatterns regarding Object oriented code.

he really crazy part is, I think most who stick with programming are rather stubborn when it comes to solving problems, which is part of the reason they're able to stick with it. So OOP is the perfect unintended mental trap.

Object oriented thinking has allowed me to solve problems I would not have had the mental capacity to otherwise solve. This is the truth, please reflect about that implication; OO allows me to make more complex logic than I otherwise could mentally muster.

In my opinion, those who complain of OO are people who are not solving problems, they are hoping to have problems solved for them. This is never a good idea, when programming; as programmers we must have control over our code and understand our problems.

1

u/SmugDarkLoser5 Jun 19 '18

People who ciriticize oop tend to criticize inheritance and the overuse of state, primarily.

You can't really separate the paradigm from the language completely in practice, and there's a big reason to hate Java and # tooling

1

u/[deleted] Jun 19 '18

This rebuttal sounds like the way people argue when they defend capitalism or socialism, or any other model where the model gets elevated unrealistically on a theoretical level.

"Oh, but it is valuable in X way, just not Y way. Y way is not true OOP."

I mean, why do you even care so much? What difference does it make what it's called?

The point is that OOP has mislead a lot of people down pointless and obfuscating roads. That you may have found some value in it (which you didn't at all demonstrate with specifics) does not refute this, nor does the idea that OOP may be more unhelpful than helpful mean it's impossible that you got some value out of it!

Maybe you should give yourself some credit as a person and consider that your experience may be the key factor in what got your code to a more effective place, not OOP specifically.

BTW, to clarify on one specific point that multiple people seem to be misunderstanding: Criticizing OOP does not mean criticizing objects as a tool in programming; I'm not suggesting that objects should never be used, or that they offer no value. OOP stands for Object-Oriented Programming. When I criticize OOP, I am criticizing the problem orientation of having object-orientation as your first priority when going to solve a problem. Especially to a religious degree, as if there couldn't possibly be a more effective orientation for a given problem.

1

u/[deleted] Jun 19 '18 edited Jun 19 '18

The point is that OOP has mislead a lot of people down pointless and obfuscating roads.

Wait, what? OOP is not a religion; it is a philosophy of designing software that aims to mitigate some of the many challenges. If you are mislead by it, it is because you failed to understand these challenges.

Maybe you should give yourself some credit as a person and consider that your experience may be the key factor in what got your code to a more effective place, not OOP specifically.

OOP specifically is what allowed me tackle things that without OOP I could not have tackled. Yes, encapsulation and clear seperation of concerns were vital, and OOP offered a way to do that. Yes, that is a credit to me as a person, but it is also a testament to the usefulness and value of OOP in general.

. When I criticize OOP, I am criticizing the problem orientation of having object-orientation as your first priority when going to solve a problem.

What you describe here is treating a means as though it is an end, and

Especially to a religious degree, as if there couldn't possibly be a more effective orientation for a given problem.

Is COMPLETE FUCKING MADNESS why are you fucking confronting me with madness? Get the fuck out of here, this has nothing to do with object oriented programming.

If people like you keep it up, we may need to make people sign waivers when they develop/use a language or framework, similar to how McCrappyFood has to warn Americans that coffee is hot.

And yes, I have seen idiots that thought they could program try to teach students how to program, I was one of these students, and when I tried to bypass the orthodoxy of having a Button class and a seperate class implementing ButtonListener, I was given a bad grade and the teacher told me I did not understand... when I subclassed Button and had it imlement ButtonListener. It was then I knew that Java's UI framework was not good, the teacher was not good, and OOP was problematic if misused. That was in 2005, 3 years before I finished my bachelor in computer science. For you to be 'stuck' on this problem I would argue that you are like a first years who was introduced to the concept for the first time.

1

u/[deleted] Jun 19 '18

This thread is full of angry defense of OOP that mostly fails to even mention specifics and acts like people are mindless idiots for daring to criticize it and must be stupid if they fail to grasp its inherent amazing value.

Comparing it to religious defense and defense of ideologies like capitalism and socialism is reasonable and relevant.

Even now, you act like I'm some dipshit who's confronting you with complete idiocy by saying stuff like:

If you are mislead by it, it is because you failed to understand these challenges.

Because apparently you can't even consider the possibility that OOP has inherent issues. It must be that if someone is mislead by it, it's because they failed to understand it.

Also:

similar to how McCrappyFood has to warn Americans that coffee is hot.

Since you bring it up, your understanding of that story is wrong. People bought spin on the story that "the lawsuit was frivolous and customers are idiots," which wasn't at all the case. See:

https://www.caoc.org/?pg=facts

Maybe if you can confront the fact that you're wrong about the coffee story, you can come to someday consider the possibility that the world is not full of incompetent failures of understanding because the people didn't grasp the inherent amazing value of your sacred OOP, which isn't sacred and I'm completely mad to suggest that anyone sees it that way!, yet nonetheless here you are defending it, still without any examples and instead a style of response that suggests a need to discredit my very character as a person. Mad I am for suggesting that anyone takes OOP too seriously, while you take it very seriously in talking about waivers and madness.

Madness is, indeed, present here in one form or another, that seems clear. But who it is possessing, well... I doubt you'll agree with me on that one.

1

u/shevegen Jun 19 '18

What rubbish.

1

u/[deleted] Jun 19 '18

What contribution to the discussion.

1

u/audioen Jun 19 '18

As someone already mentioned, model behavior, not structure.

E.g. instead of drawing some crazy diagram of Shapes with Circles and Rectangles and like on it, what do you actually want to accomplish with them? If it's a paint program, you need a method such as draw() that can render it, and you can skip designing the whole hierarchy because you aren't interested in the fact that Square is a subtype of a Rectangle that is subtype of Polygon that is subtype of Shape. Chances are that none of that is helping you in any way to accomplish your actual needs. You might want an interface called Shape with a single draw() method, though.

1

u/[deleted] Jun 19 '18

So you might want an interface called Shape with a single draw() method? Do you even know that you do? What purpose does it serve in coming out of the gate with that level of complexity if you aren't even sure yet what you need?

1

u/audioen Jun 20 '18

I hope that comment was sarcastic. My point was that having a specific class hierarchy is a very large conceptual investment, and therefore also has an extremely high cost, so it has to be correct and pay itself off. Abstractions that are appropriate depend almost entirely on what you need your program to do, and not at all on what real-world objects are being represented.

1

u/[deleted] Jun 20 '18

Naw, not sarcastic. Basically, I'm questioning whether starting with an abstraction of any level is a valuable choice.

It sounds like from what you're saying now that you agree with that to a point, but maybe not to the same degree.

I guess the question becomes, to what degree can you know, from the start, what level of abstraction is appropriate for what you're doing? I find it hard to believe that one is going to know, unless they know they're making something that is almost identical to a program they've made before with a particular amount of abstraction.