By Joyner I.
Read or Download C++?? A Critique of C++ and Programming and Language Trends of the 1990 PDF
Best programming: programming languages books
Additional info for C++?? A Critique of C++ and Programming and Language Trends of the 1990
An object reference is implicitly a union of all subclasses. Union can also be used to suppress type checking. ” Sun recognises that the union construct is unnecessary, and has removed it from Java. No equivalent exists in Eiffel. 30 Structs Struct is only in C++ as a compatibility mechanism to C. When you have classes you don’t need structs. Again, C++ is unnecessarily complicated with unneeded features. [Sun 95] says: “The Java language has no structures or unions as complex data types. ” Eiffel and Smalltalk similarly have no equivalents to struct.
Supersets group entities according to broad concepts; subsets group entities according to narrower concepts, that is, more restrictive criteria. So sets also underpin our understanding of classes and subclasses. In set theory we say: 3 ∈ N, or 3 is a member of the set of natural numbers. In objects we would say that Fred is a member of the class person. In C++ the field name which for some object contains the string “Fred” is a member of the class person. This is not mathematically correct, and the confusion could have been avoided.
A traditional system is assembled by combining modules; an object-oriented system is assembled by combining classes. Modules are a primitive form of classes; classes are more sophisticated. They express more precisely relationships with other classes. C++ #include and modules have problems. This primitive method is not required in an objectoriented language. According to Stroustrup C++ would be a better language without the C preprocessor. Most uses of #define are now covered by other mechanisms.