3 ms·
Agreed, but note that C++ doesn't require you to ever declare a class or an object. That's a Java thing you're complaining about.
by colomon 12y ago
Agreed, but note that C++ doesn't require you to ever declare a class or an object. That's a Java thing you're complaining about.
- klibertp 12y agoC++ is equally "bad" in this regard - it doesn't force you to write classes, but when you don't you're using underlying primitives which are not first class objects. In both Smalltalk and Io the expressions I gave as examples produced real objects (BlockClosure and Block instances, respectively), while in C++ this: void my_func(){ std::cout << "I'm a function"; } produces a simple pointer. Of course, this is how it should be - it follows from C++ design goals and totally makes sense for a number of reasons; however, from the perspective of OOP, this makes C++ less "pure OO" than mentioned languages (and many others).