Alec wrote: > > You say that as if C were merely an 'unreal' C++, which is just not > > true. They are two different languages, though obviously C++ is a > > derivative of C. > > With minor exceptions, a valid C program is also a valid C++ program > (See appendix B, chapter B.2.2 of "The C++ Programming Language" > for the list of incompatibilities)
Sort of. The new C99 standard shows that C is evolving away from being a subset of C++ (which it never quite was, anyway -- even in the early years of C++, it defined new keywords which were not reserved in C, so there was always at least a minimal degree of incompatibility). Of course, almost nobody supports C99, at least not yet. > > Anyone interested in C++ should learn both, in order to > > understand why C++ is the way it is. > > Opinions vary :) Well, if you consider C++ worth learning at all. >From a historical perspective, it's undeniable that C++ is what it is because of its C ancestry, particularly the desire for maximal backward-compatibility with C. This had major effects on the nature of C++. Nobody in his right mind would design something like C++ if he just wanted to make an efficient object-oriented language. > I'm actually intersted in O'Caml. I'd like to see a few real C++ vs O'Caml > benchmarks though before I start learning the language. Doug's Great > Languages Shootout is not updated any more. I sent him an improved C++ > version of one of the benchmarks that ran 5.5 times faster, but he didn't > include it. That language shootout didn't really mean much. It's nice that you sent him an improved C++ program, but the real problems are that little benchmarks don't really have much relevance to large systems, and low-level languages like C are best applied to different problems than high-level languages like OCaml. C is best at naturally low-level things like hardware drivers, memory managers, and other basic kernel functionality. More abstract languages are better for most user-level applications other than trivial ones. Craig