Subj : Re: OO compilers and efficiency To : comp.programming From : Rob Thorpe Date : Tue Jul 19 2005 11:03 am Chris Dollin wrote: > Brian wrote: > > Anyway, those are some of the things that kind of nag at me. > > I think it's a safe statement to say C can beat any OO compiled > > program pound for pound given the same programmer skill and > > adherence to language goals. > > There are so many assumptions buried there that I can only > mention a few. > > * OO languages typically [ie, Java] come with GC. C doesn't. > This can make an enormous difference to the simplicity of OO > code. That means that OO programs can tackle larger problems > with the same-ish amount of engineering effort - they can > out-produce the C programmer before the code efficiency is > an issue. (What the OO program loses in GC costs is roughly > the same as what the C program loses in memory-management > costs, eg copying.) I think your other reasons are stronger than this one. Although C doesn't come with a GC it's very simple to add one, you can download the Boehm garbage collector and use it for example. All the questions of efficiency depend on how important efficiency is. When it is important you may have to reject a language or paradigm because it can't give you the performance you need. When efficiency isn't important you can pick and choose whatever language you think is appropriate. .