Is C++ completely object oriented language?

No, it isn't. You can write a valid, well-coded, excellently-styled C++ program without using an object even once.

C++ supports object-oriented programming, but OO is not intrinsic to the language. In fact, the main function isn't a member of an object.

In smalltalk or Java, you can't tie your shoes (or write "Hello, world") without at least one class.

(Of course, one can argue about Java being a completely object-oriented language too, because its primitives (say, int) are not objects.)


C++ contains a 'C' dialect as a subset, permitting a purely procedural style of code.


The big arguments people have against declaring C++ as "pure" OO is that it still requires at least one non-OO bit, main(), and that not everything is an object (int, long et al).

It also exposes the state of an object for manipulation without using the message-passing paradigm (public members). This breaks the encapsulation of objects.

Java, on the other hand, has main() as just a static method of a class so it's closer but it still has non-object things in it.

Smalltalk is the lingua franca normally held up as the purest of the pure, but I don't know enough about it to comment.

Me, I tend to leave those sort of arguments for the intelligentsia while I get on with developing code and delivering to my clients :-)

Tags:

C++

Oop