Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!snorkelwacker.mit.edu!hsdndev!husc6!genrad!dxb From: dxb@genrad.com (Daniel A. Burkhard) Newsgroups: comp.lang.objective-c Subject: Re: Objective C vs C++ Keywords: why Message-ID: <40804@genrad.UUCP> Date: 19 Feb 91 14:17:43 GMT References: <60377@eerie.acsu.Buffalo.EDU> <44957@nigel.ee.udel.edu> Sender: news@genrad.UUCP Lines: 58 In article <44957@nigel.ee.udel.edu>, carroll@cis.udel.edu (Mark Carroll) writes: > ... stuff deleted > 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. ............ How so ?? C++ gives you member access control private (default), public, and protected. A user has no direct access to private members, i.e private members can only be changed thru the public interface of a class. [ Of course these rules can always be violated in any language that supports access to raw memory ...] > 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. I'm not exactely sure what you mean by "rewritten", but of course something like class foo { int a; public: foo(int aa=1) { a = aa;} int geta() { return a;} }; class bar: public foo { int b; public: bar(int bb=2) { b =bb; } int geta() { return b;} }; is perfectly legal in C++ [note: no "virtual" here]. > .. stuff deleted > ..................... 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. This seems to be a contradiction to your first point. -- dan ------------------------------------------------------------------------------- Dan A. Burkhard Internet: dxb@genrad.com GenRad, Inc UUCP: ...!genrad!animal!dxb 300 Baker Ave Phone: (508) 369-4400 X3304 Concord, MA 01742 ------------------------------------------------------------------------------