Article View: comp.lang.objective-c
Article #56Re: Objective-C vs. C++
From: Mark C. Carroll
Date: Thu, 27 Aug 1992 17:33
Date: Thu, 27 Aug 1992 17:33
61 lines
3618 bytes
3618 bytes
In article <l9pvs3INN23a@west.west.sun.com> comp.lang.objective-c writes: >It seems that I'm the only person who I've heard say that the best features >of C++ have nothing to do with object orientation. > >The power of operator overloading provides the programmer with the ability to >define a data structure and the operations on it. Since the natural >progression of reusable software is from in-line-code -> function -> >library-member -> language feature, this functionality is key in providing a >powerful, high level language. > You don't seem to have a good grasp on the terminology... First of all: what you are describing above is _not_ operator overloading. Operator overloading is simply the ability to define the meaning of the languages operators. The ability to define a data structure and the operations on it is one of the basic features of object orientation. Add in inheritance, and that IS object-orientation as implemented in C++. >The ability to define template classes takes the notion of code reusability >another step. The container class and the operations on it are defined once >and the programmer instantiates this template class as needed for each type, >removing the need for repeated code modification. > The ability to define templates (not just template classes, but templates as a whole) is a feature added to C++ to overcome a weakness in its type system. In other languages, other methods of reusing code have been implemented. In Objective-C, there is no need for templates because of weak types/fully dynamic binding. In Standard-ML, there is no need for templates because the type system is sufficiently powerful to cope with polymorphic functions without the help provided by templates. Frankly, I consider templates to be one of the greatest weaknesses of C++ - they're only needed because C++ chose to use a strong by unintelligent type system. With a weaker type system, or a strong intelligent type system, the template kludge is unncessary. >The exception capability is nice, but overly complex and will meet with >widespread lack of use, much like the MI features. Exception handling is _absolutely_ _crucial_. In _every_ major production program, exception handling is absolutely pervasive. In the past, it's always been done fairly kludgily, with gotos, setjmps, and other bizzare messes. The C++ system is certainly excessively complex and confusing, but it's THERE. It exists, it works, and it's a whole lot better then setjmp/longjmp. I tend to think that the presence of a functional standard exception handling mechanism is one of the best additions to C++ since the language was initially released. (I wish it were a better system, but I'm glad to have it. I wish Objective-C provided as much!) <MC> -- || Mark Craig Carroll: <MC> ||"Don't ever think that you can't || Univ of Delaware, Dept of CIS|| change the past || Grad Student/Labstaff Hacker || or the future" || carroll@udel.edu || - _Love_and_Anger_, Kate Bush
Technical Details
Message-ID:
<1992Aug27.173341.2549@udel.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!haven.umd.edu!darwin.sura.net!udel!louie!mercury.cis.udel.edu!carrollReferences:
<rmartin.714926059@thor> <l9pvs3INN23a@west.west.sun.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.objective-c Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!haven.umd.edu!darwin.sura.net!udel!louie!mercury.cis.udel.edu!carroll From: carroll@mercury.cis.udel.edu (Mark C. Carroll) Subject: Re: Objective-C vs. C++ Message-ID: <1992Aug27.173341.2549@udel.edu> Sender: usenet@udel.edu (USENET News Service) Nntp-Posting-Host: mercury.cis.udel.edu Organization: University of Delaware, Newark References: <rmartin.714926059@thor> <l9pvs3INN23a@west.west.sun.com> Date: Thu, 27 Aug 1992 17:33:41 GMT Lines: 61