Subj : Re: OO compilers and efficiency To : comp.programming From : Flavius Vespasianus Date : Thu Jul 21 2005 02:22 am "Rob Thorpe" wrote in news:1121849306.769176.300410@g43g2000cwa.googlegroups.com: > Flavius Vespasianus wrote: > Calling a virtual function may be though. For example, the code > must:- pointer> > > > > > > Calculating the address of the virtual function can usually be done through indexed mode addressing. The stack frame setup is the same no matter what language you use. Using temporaries can cause problems. Use const references to get around most of them. >> The alternative, in the absence of OO is a large case statement; >> hardly efficient either. > > What the OP is talking about is using getter and setter functions > rather than global variables. So, in this case a load from memory > could be used instead. If it can be done in one or two instructions, there's no reason the C++ can't inline it into the same number of instructions. > Interesting, personally I think C is a beautiful programming language. > There are many better languages today, the problem is that they are > not so well known. For elegance in systems software, you should see BLISS. Too bad AT&T was giving C away for free while Digital was charging $40,000 (10 times what it charged for C) for Bliss. Bliss had an unbelieveable macro language that you could build all kinds of tables with. Bliss also allowed you to lay out structures down to the bit level, something great for systems work. It's unfortunate that language usage has been driven by hype and marketing factors rather than actual usability. I find it amazing that there are people out there who actually think that C# or Java are improvements over C++.....or that the Java byte code was an original idea. We should be using something today that: 1. Has pascal syntax simplicity and safety 2. Ada threading and templates (tasks and generics) 3. C++ OO capabilities 4. Bliss macros !!!!! I do a lot of code conversion from C++ to Object Pascal and every time I find many programming errors in my C++ code because of Pascal's much better error checking. For my main project, it takes several minutes to compile the C++ version. The equivalent Object Pascal code compiles in less than a second. .