Why C++ is Not a Pure Object Oriented Language

Published: 09 July 2014
on channel: Techy Help
4,151
like

Do you know why C++ is not a pure Object Oriented language?

C++ can be considered C with classes tacked on.

Those classes are the basis of objects, AKA object oriented programming. I heard that in class.

C++ is similar to Java, but not quite.

Java, at least, is considered a pure object oriented language. A security hole filled, often updated and painfully error prone but pure object oriented language.

If you want a true object oriented language and want to stay with C, go with Objective C.

If I learn that, I'll be working for Apple or someone who writes apps for Apple. Why would someone say coding in C++ isn't writing OO code?

You can write code in C++ without classes and objects, whereas true object oriented languages can't be written without objects.

I've heard it is or is not object oriented depending on your definition of object oriented.

Oh, please, no arguing over what the definition of is will be.

No, just object oriented, like whether C++ is in the same class as Ruby and Smalltalk?

Ruby and Smalltalk are object oriented, yes, but C++ can be if you use the classes for everything.

But you don't have to use classes, so it isn't object oriented.

If you really want to go down that road, primitive types aren't objects themselves, so you could argue Java isn't object oriented.

That argument only wins extra credit points on a programming class test. Or on a forum where you want to find another reason to bash Java.

As if anyone needs another reason to bash Java. But the standard says Java is OO.

But what about the standards that say primitive types are called objects?

I haven't seen the standards, so I don't know if that's a standard answer. But if you can program in C++ without using objects, then it isn't an object oriented language.


Watch video Why C++ is Not a Pure Object Oriented Language online without registration, duration hours minute second in high quality. This video was added by user Techy Help 09 July 2014, don't forget to share it with your friends and acquaintances, it has been viewed on our site 4,151 once and liked it like people.