2 ms·
As I read it, the argument was that C was object-oriented "enough" to qualify as OO. (I've done object-oriented C, with function pointers in structs. It works
by AnimalMuppet 4y ago
As I read it, the argument was that C was object-oriented "enough" to qualify as OO. (I've done object-oriented C, with function pointers in structs. It works just like virtual functions.) But C has no destructors, and destructors are the difference between "mere" OO and "something you can build on".
As I said, that's how I read it. But it could be that your reading was correct...
- Rochus 4y agoYou can do OO programming in assembler, but that doesn't make assembler an OO language; the same applies to C. Therefore C cannot be "O-O enough" by definition, and nobody who knows an OO language can seriously state that "O-O does not add much power".
- moloch-hai 4y agoAM has got it right. Inheritance is just not often useful, unless you have nothing else to organize with. Sometimes it is just the right thing, but not often enough to need to be built into the language. If your language is expressive, you can make an inheritance library and use it to make your base and derived types on those occasions when they actually are useful.