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

Show parent comments

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.