Live data from Hacker News

Moving Beyond the OOP Obsession

prog21.dadgum.com

11–20 of 72 posts

Re: Moving Beyond the OOP Obsession

#11
post #3

I don't disagree with the author's sentiment about inheritance (or OOP in general), being used and taught wrongly, but I still think it's a necessary tool to have available. Without inheritance, as soon as you want to cast mixer to something else, you're either relying on binary wizardry by the compiler (reinterpret_cast. ie, undefined behaviour), or you need to break encapsulation to copy the fields over from one ob…

You're describing subtyping which, like modularity, does not require inheritance or really any other part of "OOP".

I think that supports the article's point that C++, Java, etc. only support certain language features in an ad-hoc way tied to their object systems, making them, among other things, poor teaching languages.

Re: Moving Beyond the OOP Obsession

#15
post #6

What baffles me about OOP is that massive aspects of how to use it have changed, and that change happened after it gained popularity as a good technique. How could it have become popular when people were doing it wrong? The article mentions inheritance, but there's also heavy vs light classes. When I was taught OOP, an object knew how to do all the things to itself. It could draw itself on the screen, modify itself,…

"Was it just misunderstood and inheritance has always been known to be something to avoid and light (single public method) classes always been a good idea but computer science professors didn't understand it?"

Could be. Or it could be that it's possible to write working programs with many different methodologies and 90% of what developers argue about is fashion not substance...

Re: Moving Beyond the OOP Obsession

#16
I could take that text more seriously if it at least discussed the limitations of the most powerful embodiments of OOP that we have today and not the accidental limitations of languages that for one reason or the other ended up not as good as they could have and force you to jump through hoops, as evidenced by the very mentions of classes, constructors, private methods etc., none of which are fundamental to OOP but all of which were made fundamental to certain languages.

Re: Moving Beyond the OOP Obsession

#18
post #16

I could take that text more seriously if it at least discussed the limitations of the most powerful embodiments of OOP that we have today and not the accidental limitations of languages that for one reason or the other ended up not as good as they could have and force you to jump through hoops, as evidenced by the very mentions of classes, constructors, private methods etc., none of which are fundamental to OOP but a…

I agree, but OTH you can be a Platonist and refute every criticism with this argument. In the end the OOP you have is the OOP that has been implemented, so judging the implementations we have to work on is more down to earth.

Re: Moving Beyond the OOP Obsession

#19
post #14

A value, with a type. Nothing else. Stop highjacking everything into your OO religion. If you take everything of a value that originated elsewhere, there will be nothing left in the OOD.

> Stop highjacking everything into your OO religion.

The parent to your post seemed to have a legitimate question, and you're being snarky. You could have left out everything after the first sentence or even explained what that means in practice.

Post reply on HN