Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!ames!elroy!gryphon!sarima From: sarima@gryphon.COM (Stan Friesen) Newsgroups: comp.lang.c++ Subject: Re: objective C Message-ID: <15327@gryphon.COM> Date: 30 Apr 89 17:21:04 GMT References: <2614@ssc-vax.UUCP> <3180@stpstn.UUCP> Reply-To: sarima@gryphon.COM (Stan Friesen) Organization: Trailing Edge Technology, Redondo Beach, CA Lines: 32 In article <3180@stpstn.UUCP> cox@stpstn.UUCP (Brad Cox) writes: > >Sorry I'm late in responding to your article. I monitor this network >very irregularly these days. > DITTO >Of course, none of this answered your real question...why highly >reusable software (Software-ICs is a trademark...it applies STRICTLY to >Objective-C, by law) is harder in C++ (never impossible...remember I >used to do this stuff in raw C too). The short answer is that C++ >relies on static binding and strong type-checking, while reusing code >involves binding a supplier's code with a consumer's code long after >the supplier's code has been compiled (and therefore bound to whatever >types the supplier knew about at the time...which fails to include the >consumers'). For the longer answer, read the book >again...closely...and try working the examples in C++. This seems to be a common mistake of less intensive C++ programmers. C++ does not *rely* on static binding, it *permits*, or perhaps *encourages* it, but definitely not rely! Dynamic binding in trivially available, it is called "virtual functions". Of course since all "functions/messages" are "virtual" in ObjC, attempting to code any ObjC class that relies on library classes in C++ would require writing the associated library using virtual functions. But I do not see any other problem that would prevent the example from being done in C++. Admittedly, ObjC is more advanced in its standard library of predefined classes, but that is its only real advantage over C++. -- Sarima Cardolandion sarima@gryphon.CTS.COM aka Stanley Friesen rutgers!marque!gryphon!sarima Sherman Oaks, CA