Subj : Re: OO compilers and efficiency To : comp.programming From : Rob Thorpe Date : Wed Jul 27 2005 07:29 am Gerry Quinn wrote: > In article <1122402008.124827.269060@f14g2000cwb.googlegroups.com>, > robert.thorpe@antenova.com says... > > 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. ^ This specific bit your quoting makes a different point to the one you address. > Nonsense. The C-like bits should be encapsulated in classes with > standard interfaces - there is no reason for them to be exposed to the > main part of the program. Ideally yes. But if you're writing a part of the program in the C style it is probably for performance reasons. Parts of the code like this are commonly changed as new ideas come along for improving performance. This means although these parts of the code are behind standard interfaces they're important and their maintainability is important. The extent to which all this affects things varies from program to program. .