From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,45b50f14dadfce5b X-Google-Attributes: gid1164f8,public X-Google-Thread: 102b75,45b50f14dadfce5b X-Google-Attributes: gid102b75,public X-Google-Thread: 110292,45b50f14dadfce5b X-Google-Attributes: gid110292,public From: sjc@netcom.com (Steven Correll) Subject: Virtual functions (was Re: Final kick at the "Merced Guessing Game") Date: 1997/10/03 Message-ID: #1/1 X-Deja-AN: 277494182 Sender: sjc@netcom22.netcom.com References: <3431A2DB.4273@EasyInternet.net> <60ui2q$33a$1@cdn-news.telecom.com.au> <60vj9p$7mg@vidar.diku.dk> <610gbg$k3t@deadzone.rsn.hp.com> Organization: Netcom Newsgroups: comp.sys.intel,comp.arch,comp.sys.dec In article <610gbg$k3t@deadzone.rsn.hp.com>, Patrick F. McGehearty wrote: >On the C++ virtual function issue, what is needed is more training of C++ >programmers to avoid inefficient constructs except when they are really >necessary, and to provide whatever language advisories possible to help the >compiler along... >Virtual functions that cannot be optimized to static addresses at compile or >link time are the enemy of performance, and future processor speed >improvements will only make situation more extreme. Telling C++ programmers in 1997 to avoid virtual functions because they make the program run slower is a lot like telling Fortran programmers in 1970 to avoid subroutine calls for that same reason. They are all too likely to follow your advice, and given the choice of maintaining a ten-year-old C++ program with "virtual" missing from most but not all of its functions, versus a twenty-year-old Fortran program which was written as a single 100000 line subroutine, I might choose the Fortran program--at least it's provably possible to restructure it based solely on static information. But probably I'd just look for a new line of work, like clearing stuck toilets. -- Steven Correll == PO Box 66625, Scotts Valley, CA 95067 == sjc@netcom.com