Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp
Path: utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxr!ulysses!allegra!oliveb!Glacier!decwrl!sun!rmarti
From: rmarti@sun.uucp (Bob Marti)
Newsgroups: net.lang
Subject: Re: C++ available (C++ and Modula-2)
Message-ID: <2944@sun.uucp>
Date: Mon, 28-Oct-85 20:07:01 EST
Article-I.D.: sun.2944
Posted: Mon Oct 28 20:07:01 1985
Date-Received: Wed, 30-Oct-85 07:17:21 EST
Distribution: net
Organization: Sun Microsystems, Inc.
Lines: 52

In reponse to message <4487@alice.UUCP> by Bjarne Stroustrup (AT&T Bell Labs):

First of all, let me make absolutely clear that my main intention was to
compare Modula-2 to "vanilla" C and not to C++.  Since this may not have
been quite apparent in view of the title "Re: C++ available", I included a
disclaimer to this effect.  At this point, I do not know C++ well enough
C++ to be able to critically appraise the language.  However, some of your
remarks in your reply to my original posting seem to indicate that your
knowledge of Modula-2 is rather weak as well ...

Now some remarks to the points you raised:

(1) Thank you very much for telling me so much about type checking I did not
    know!  Seriously, though, I don't see what passing a pointer to a vector
    of functions or a zero-terminated list of pointer arguments has to do with
    type checking.  If you want to say that Modula-2 does not support the
    varargs stuff, you are right, it doesn't.  You can pass an array or a
    pointer to an array of procedure variables, however, and you can also pass
    zero-terminated arrays whose elements are of type ADDRESS, and coerce them
    into their appropriate types inside that procedure (just like in C).  If
    C++ does more than that, that is just fine!

(2) Modula-2 does have facilities to define abstract data types, and an
    object-oriented programming style is also supported to some degree:
    Data abstraction is achieved by the textual separation of type and
    procedure declarations from their representations/implementations.
    (The representation of a data type can be hidden by declaring an "opaque
    type" in a definition module).  An object-oriented programming style in
    Modula-2 typically involves the use of procedure variables as the fields
    of the representation of an opaque type.

(3) I don't know why you think Modula-2 would have been a much more
    interesting language if it had appeared in 1978 as Pascal-2 (!), but
    I can assure you that Modula-2 *did* appear in late 1978 (see N. Wirth:
    "Modula-2." Swiss Federal Institute of Technology Zurich, Instut fuer
    Informatik, Report Nr.27, 1978).  As far as I recall, even a compiler
    generating PDP-11 code was publicly available at that time.
 
(4) As far as the quality of Modula-2 books, especially Wirth's book, versus
    the quality of K&R is concerned, I think this is largely a matter of taste.
    But even if you rate K&R considerably higher than Wirth's Modula-2 book,
    it still is a very lame excuse for not looking into Modula-2.
 
(5) Class-concept, inheritance, data hiding, operator overloading, etc. sounds
    just fine to me.  I will certainly have a thorough look into your book on
    C++.  It'll probably quite a while until I'll get a chance to use C++,
    though.  I agree that at least inheritance and operator overloading are
    a considerable step beyond the facilities of either C or Modula-2, and
    I also realize that the design and implementation of these facilities
    are non-trivial, to say the least.
 
--Bob Marti, {decvax, ucbvax, seismo}!sun!rmarti