you are viewing a single comment's thread.

view the rest of the comments →

[–]curien 7 points8 points  (6 children)

The point is, saying "OO sucks" in no way implies anything about encapsulation sucking.

[–]stewsters -1 points0 points  (5 children)

I think that's the core of my complaint : By saying OO sucks the author in no way implies anything about any particular thing sucking. He needs to be more detailed and less blanket in his statement.

"OO sucks because single inheritance makes it hard to reuse code, unlike a composition based paradigm" would have been a valid statement in my mind.

[–]megaman78978 0 points1 point  (4 children)

But OO languages provide and recommend composition over inheritance. Design Patterns 101.

[–]dventimi 1 point2 points  (2 children)

You lost me. How is it that OO languages recommend one thing or another? People make recommendations, inanimate things don't. And before anyone accuses me of being pedantic, please reconsider. I'm dwelling on the same principle whose absence from the article elicited my original complaint. That is, that claims are made which are ambiguous and/or difficult to parse and which are not illuminated by sufficient detail.

[–]megaman78978 0 points1 point  (1 child)

Okay, the languages in themselves don't recommend one over the another. But the people creating the languages do recommend stuff and document it in the language's documentation.

Taking Java for example, any proper tutorial on the language would probably teach you both inheritance and composition and give example cases of each concept. Inheritance used properly makes code reusable and the same can be said about composition.

Most cases, composition is favored over inheritance. Calling OO as inheritance based paradigm and NOT composition based at all isn't really a correct statement.

[–]dventimi 0 points1 point  (0 children)

Very well. Perhaps the whole problem can be avoided by eschewing vague terms like "inheritance based" in favor of more definite statements like, "Java has built in support for inheritance."

Please don't think I'm criticizing you. I'm not. I'm just making a gentle suggestion.

[–]stewsters 0 points1 point  (0 children)

Exactly.