Having read "The Design and Evolution of C++", I have to disagree with your comparison of C and C++. C++ did a lot more than simply add OO methods. Examples:
1) greatly reducing the need for macros, which can cause subtle bugs that are hard to isolate. This is accomplished through the use of const variables and templates.
2) increasing the strength of the type system, which forces the programmer to be explicit when performing unsafe conversions. While annoying, this forces the programmer to be more conscientious of unsafe casts.
3) By using a gradual evolution, C++ was able to keep its size modest, the compiler efficient, and allow programmers to slowly add features that C++ offers to their code without penalizing them for unused features.
4) Operator overloading allows C++ to create classes behave like built-in data types. A matrix class can be built that has meaningful + and * operators and will also warn you at compiler time if you attempt a nonsensical operation, like adding a matrix to an integer.
There are numerous other changes that C++ introduces. For me, the ultimate change that impacts me on a regular basis is the difference between
and
Code:
printf("%d",myint);
cout uses operator overloading to correctly output an integer every time. With printf, if I make a mistake and use the wrong specifier for my data type (like %d with a double instead of an int), the compiler won't complain and I'll get REALLY strange bugs. The same applies to cin vs scanf.
1) I'm not sure what you mean by this.
2) what if I disagree with the structure you impose on me?
3) thinking about OOP is inherently not unified (See Java vs C++ for many examples). OIOIC will not change that.
4) C and C++ code can be linked together, as can Fortran code. I suspect you don't see how different languages serve different purposes. My take on it is that you are re-inventing the wheel.
Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum