Why is C++ not considered a purely object oriented language?

  • C/C++
  • Thread starter C0mmie
  • Start date
  • Tags
    C++
In summary, C++ is an object-oriented language, but the OO is basically welded on top of a language (C) not designed for that purpose. This can make the design of classes less-than-optimal, and it can be a pain in the ass to use sometimes. Additionally, Smalltalk was one of the first OO designed languages, but there are many others. Java is a popular choice for development in the internet world, but it is not suitable for contests. C++ is a hybrid language, which means that you can learn both procedural oriented programming as well as object oriented programming. For system programming you have the power in C or Assembly Language, but for AI based or expert system development I will like
  • #1
C0mmie
64
0
I am a student of computer science, and naturally was shocked when, during my recent trip to a bookstore, was told that C++ in not really object oriented. The guy at the store referred me to a language called Smalltalk, which is supposedly the true object oriented language. I assume that most people would share my point of view in agreeing that C++ is an object oriented language, but can someone explain to me why it would not be considered as such, while Smalltalk would.
 
Technology news on Phys.org
  • #2
C++ is object-oriented; however, the OO is basically welded on top of a language (C) not designed for that purpose. So the design is less-than-optimal, and it can be a pain in the ass to use sometimes. Those of us that remember using tempates and STL in the old days know this well... :)

Smalltalk was IIRC one of the first OO designed languages, but there are many others. I like Java, personally.
 
  • #3
Hello!
You can read:

Hi!
Of-course "Class" is good as it reflects OOP, but in contests (Real Time) though you have "BigInt" type class, you then can use the functions only. You don't need to write the OOP feature based codes.

But, the class need to be well implemented in sense of OOP and as well as proper memory usage and readability. I am learning Java (and C#) and I like it as a developer's language which is for internet programming and other professional works, But not suitable for contests.

C++ is a hybrid language. For contests and also for learning purpose C++ is the best I think. Because here you can learn both procedural oriented programming as well as object oriented programming. For system programming you have the power in C or Assembly Language. For AI based or expert system development I will like PROLOG as it works with clauses and logic. It's also goal oriented. And that's why it is easier than LISP as I saw LISP is full of brackets and brackets. For mathematics related problems you can use MATLAB or Maple or Mathematica type soft packs. They are good for engineering purpose.

And another important thing, don't make it habit to use the advanced routines provided by the complier or any company or internet. Try to make it yourself otherwise you will be lazy like me who is fond of ready-made codes provided by my friends. I always use my junior students to make the code for me. I make the algorithm clear to them and they do the rest for me.

Oh! Last thing, you can make your BigInt class into BigNumber class by give it the power of real value arithmetic with huge precisions. It can easily achieved by inheritance. You can inherit all the properties from BinInt class and extend it by writing procedures for real i.e. long float or double type values.

Taken from:

http://acm.uva.es/board/viewtopic.php?t=370&start=30
 
Last edited by a moderator:

1. Why is C++ considered not object oriented?

C++ is considered not purely object oriented because it allows for both object-oriented and procedural programming styles. This means that C++ allows for the use of traditional structured programming techniques in addition to the use of objects and classes.

2. How is C++ different from other object-oriented languages?

C++ differs from other object-oriented languages like Java and Python because it was originally designed as an extension of the C programming language, which is not object-oriented. This means that C++ has features and syntax that are not strictly object-oriented.

3. Can you still write object-oriented code in C++?

Yes, C++ does support object-oriented programming. It allows for the creation of classes, objects, and inheritance, among other features commonly associated with object-oriented languages. However, it also allows for the use of non-object-oriented programming styles.

4. What are some potential drawbacks of C++ not being purely object-oriented?

One potential drawback is that it can be more difficult to maintain and modify code written in a mixture of object-oriented and procedural styles. Additionally, developers may need to have knowledge of both styles in order to work with C++ effectively.

5. Are there any advantages to C++ not being purely object-oriented?

One advantage of C++ not being purely object-oriented is that it allows for more flexibility and control over memory management. Since C++ is a low-level language, it gives developers the ability to directly manipulate memory, which can be useful in certain applications. Additionally, it can be easier to integrate C++ code with code written in other languages that do not support object-oriented programming.

Similar threads

  • Programming and Computer Science
Replies
8
Views
875
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
1
Views
925
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
2
Replies
54
Views
3K
Replies
13
Views
2K
  • Programming and Computer Science
Replies
10
Views
1K
Back
Top