Path: utzoo!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hp-pcd!hplsla!jima From: jima@hplsla.HP.COM (Jim Adcock) Newsgroups: comp.lang.c++ Subject: Re: C++ and other OOP Langs Message-ID: <6590101@hplsla.HP.COM> Date: 18 Apr 89 17:18:00 GMT References: <615@marob.MASA.COM> Organization: HP Lake Stevens, WA Lines: 55 [My opinions, based on a couple years programming in ObjC and C++] > I've only read about Objective C, and written a few small C++ programs. It > seems to me that there is a significant performance penalty to be paid for > using Objective C (or SmallTalk), due to massager overhead, for example. Yes. > C++ is most often criticized for not being sufficiently object oriented. > But I wonder if this is analogous to criticizing C for not having any > I/O facilities defined as part of the language? Yes. > That is, is it possible > that with a standardized class library (like K. Gorlen's, for example) that > C++ can be made as flexible (i.e., "object oriented", particularly at > runtime) as Objective C? Yes. As flexible, and probably more so, only different. Some standard classes could certainly be useful for the 95% of the programming usage where your needs don't call for the ultimate in speed or space efficiency. If you're going to want to optimize for that last ounce of performance in the critical paths, you may not want to use a standard class. Once we have exception handling and memory management, then we should expect to see a variety of world class reusable base classes. Writing truly reusable no compromise base classes is not trivial. I believe for many base classes operator overloading is necessary to allow natural usage of base classes as extensions of the language. Clearly this is true for math classes such as Complex, Vector, or Matrices. You want to be able to say: a = b + c; Not: [a assign: [b add: c]]; This is also true of non-math classes: myCollection[i] = myObject; Not: [myCollection atIndex: i assign: myObject]; These are trivial examples of the importance of operator overloading in making natural feeling base classes. I'm sure others can come up with more important examples. I have to admit that I'm less than totally convinced that the Gorlan classes are the way to go. I don't think we should be trying to copy Smalltalk approaches in C++. I think new, better ways can be found within the context of C++.