Xref: utzoo comp.lang.c++:11991 comp.object:2639 comp.lang.objective-c:186 Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!pdn!tscs!tct!chip From: chip@tct.uucp (Chip Salzenberg) Newsgroups: comp.lang.c++,comp.object,comp.lang.objective-c Subject: Re: Static typing and OOP efficiency Message-ID: <27D153AA.12CF@tct.uucp> Date: 3 Mar 91 19:51:05 GMT References: <66645@brunix.UUCP> <6494@kermit.UUCP> Organization: Teltronics/TCT, Sarasota, FL Lines: 34 According to andyk@kermit.UUCP (Andy Klapper): >Objective-C staticly bound messages are just as fast as C++ virtual functions. I believe this statement to be correct. >How much messageing do you guys do relative to the rest of your application? Given the low cost of "messaging" (calling of member functions) in C++, I rely on it quite heavily -- certainly more than I would in Objective C. >Did you know that the function calling sequence used by Pascal is faster AND >smaller than the one used in C ? Why aren't you using Pascal ? I am disappointed to see such misinformation from a language technician. Neither C, nor C++, nor Pascal has _a_ calling sequence. It is true that typical C implementations have been less efficient than typical Pascal implementations. That is true only because pre-ANSI C compilers were unable to determine whether a called function was variadic. ANSI C has made function prototypes mandatory for variadic functions, and C++ requires prototypes for all functions. So Pascal, C and C++ compilers are on equal ground. This point is not simply academic. Zortech C++, for example, uses the Microsoft Pascal calling sequence for all non-variadic C++ functions. Now perhaps we can leave aside piddling issues like calling sequence and tend to the more significant issues of dynamic and static typing. >My much biased point is that concentrating on this one issue is myopic. Concentration on any one issue is myopic, if it is at the permanent expense of other issues.