Article View: comp.lang.objective-c
Article #243Re: Objective C vs C++
From: Daniel A. Burkhard
Date: Fri, 22 Feb 1991 01:06
Date: Fri, 22 Feb 1991 01:06
58 lines
2377 bytes
2377 bytes
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
------------------------------------------------------------------------------
Technical Details
Message-ID:
<12388@fpssun.fps.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!celit!fpssun!rootShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!celit!fpssun!root From: dxb@genrad.com (Daniel A. Burkhard) Newsgroups: comp.lang.objective-c Subject: Re: Objective C vs C++ Message-ID: <12388@fpssun.fps.com> Date: 22 Feb 91 01:06:42 GMT Sender: root@fpssun.fps.com Lines: 58