From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dab7d920e4340f12 X-Google-Attributes: gid103376,public From: johnherro@aol.com (John Herro) Subject: Re: C is 'better' than Ada because... Date: 1996/08/16 Message-ID: <4v14u7$hkl@newsbf02.news.aol.com>#1/1 X-Deja-AN: 174755041 sender: root@newsbf02.news.aol.com references: <3212F127.41C67EA6@mailgw.sanders.lockheed.com> organization: America Online, Inc. (1-800-827-6364) newsgroups: comp.lang.ada Date: 1996-08-16T00:00:00+00:00 List-Id: Mike Roske writes: > [Ada] does not readily provide for... pointers > to subprograms, and assigning a pointer to > an existing object. ... I haven't yet taken a > close look at Ada95. Ada 95 lets you do both of these easily. However, IMO it's easy to overuse these features, especially assigning a pointer to an existing object. In Ada 83, either the pointer or the object pointed to has a name, but not both. That's adequate for most purposes. However, assigning a pointer to an existing object is useful for interfacing to C programs, and for creating linked lists and trees without dynamically allocating memory. (I got that from RENDEZVOUS WITH ADA 95, by David Naiditch, p. 398.) You'll find that there's much less need for pointers in Ada than there is in C. I think that's a good thing, because pointers tend to be error prone. > I find Ada too restrictive. Ada *IS* more restrictive, but the restrictions help prevent errors. In Ada you *cannot* produce a dangling reference, unless you deliberately use Unchecked_Access or Unchecked_Deallocation. > The added checking that Ada compilers provide > before and after each subprogram call and > assignment is unnecessary in many cases. Again, this is to help prevent errors, but the checking can be turned off when and where this is desired. - John Herro Software Innovations Technology http://members.aol.com/AdaTutor ftp://members.aol.com/AdaTutor