Subj : Re: OO compilers and efficiency To : comp.programming From : Rob Thorpe Date : Tue Jul 26 2005 12:20 pm Chris Sonnack wrote: > websnarf@gmail.com writes: > > > So is the answer to the OP's question: you don't write code that is > > really C code, but rather, you translate it to C++ equivalents that > > behaves exactly like it was C code, so that the compiler can produce > > the same result? > > Sure, why not? The upside of a mixed-mode language, like C++, is that > you can strip down to the bare essentials when necessary but also have > the language-supported abstraction of OOD available. This is OK for little bits of code, but not for large pieces. Doing this gives you all the downsides. The developers must be conversant with C++, that is everybody must know what a virtual const friend private method is and how it behaves. This also means all the developers have got to be really smart. Then you have the problems of C++ to deal with: different compilers have subtly different opinions of what constitutes C++, making porting difficult. They express their opinions with rather curious error messages. After you've dealt with those you've written parts of your code in the C style. Probably the most important parts for performance and parts that you want to change often. These have all the problems of C, they're verbose and they require great attention to detail that is in other languages unnecessary. I maintain an application written in this "C++ and C-style C++" way, it's awful and it's very often troublesome to change. .