Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!wuarchive!udel!cis.udel.edu From: carroll@cis.udel.edu (Mark Carroll) Newsgroups: comp.lang.objective-c Subject: Re: Objective C vs C++ Keywords: why Message-ID: <44957@nigel.ee.udel.edu> Date: 18 Feb 91 18:38:26 GMT References: <60377@eerie.acsu.Buffalo.EDU> Sender: usenet@ee.udel.edu Organization: University of Delaware Lines: 47 Nntp-Posting-Host: mars.cis.udel.edu In article <60377@eerie.acsu.Buffalo.EDU> summers@acsu.buffalo.edu (Michael Summers) writes: >Why would I want to use Objective C ? Can any one give me a >short description of the pros and cons of the two >languages? > >There is a lot of support for C++ in terms of PD software >and vendors but hardly any for Objective C. Perhaps this >will change when the new g++ come out. This lack of broad >support is a definite limitation to Objective C whatever its >attributes. What is so superior about Objective C that would >induce me to abandon this support? > Contrasting Objective-C and C++ in this way doesn't make sense. Obj-C and C++ are designed for very different purposes. The languages should not be competing. C++ is a systems language. It's very low level, very fast, etc. It's optimized towards very low level programming. It's not very good at abstraction. It's completely impossible to implement a class in a way where a user cannot change the private parts of the class, or alter the class declaration. C++ is almost completely statically bound; dynamic binding only comes into play when you start using virtual function, and only functions tagged virtual can be rewritten in your subclasses. Objective-C is an applications language. It's higher level than C++. It's not quite as fast, but in exchange for the (minor) loss in speed, you gain a much more dynamic language. All object method calls are dynamically bound, unless specifically forced to be static. (Sort of the opposite of C++. C++ is static unless forced dynamic; Obj-C is dynamic unless forced static.) All member functions can be reimplemented in subclasses. Also, in C++, it is possible to distribute object-code for classes, without the corresponding source. You can present objects which the user can make full use of, but cannot alter without implementing a subclass. The private parts of one of these classes can NEVER be changed by their users. In summary: Objective-C is NOT superiour to C++; C++ is NOT superior to Objective-C. They are different languages with completely different aims. -- ---------------------- Mark Craig Carroll: ------------------------ ------ U of Del. Grad Student in CIS ------ EE/CIS LabStaff Hacker ------ -- Resident Wierdo @ 105 E Cleveland Ave, Newark DE - carroll@udel.edu -- ---------------------- Shalom Achshav - Peace NOW! ----------------------