comp.lang.ada
 help / color / mirror / Atom feed
From: Jerome Desquilbet <jDesquilbet@Rational.COM>
To: Nasser Abbasi <nabbasi@qualcomm.com>
Subject: Re: on OO differnces between Ada95 and C++
Date: 1996/02/20
Date: 1996-02-20T00:00:00+00:00	[thread overview]
Message-ID: <3129F185.41C6@Rational.COM> (raw)
In-Reply-To: 4gbq7q$g08@qualcomm.com

Nasser,

You have pointed out one of the main differences between Ada and C
compilation models (and as far as the compilation model is concerned,
Ada 95 is not different from Ada 83, and C++ is not different from C).


- The C/C++ compilation paradigm is _independent_ compilation.

- The Ada 83/95 compilation paradigm is _separate_ compilation.


It has nothing to do with the OO features of the two languages.


The comparison between these two compilation models would take some
place, but here a list of some comments about the C/C++ compilation
model:

- .C files may be compiled in any order

- .h files are not compiled

- there is no way to avoid use of the preprocessor (at least for
#include)

- there is no way to oblige the programmer to write all the #include
directives: he may take advantage of some "hidden" includes (nested at
more than one level)

- the really compiled file (the compilation unit) is the result of the
preprocessing phase

- conventions like

  #ifndef X_H_
  #define X_H_
  ...
  #endif

  in headers to prevent multi-inclusion are only conventions, they are
not part of the language

- you may have several different definitions for the same class in the
same program, as long as they are never compiled together in the same
compilation unit; example:

#define private public // *** BERK! ***
#include "...h"        // second definition for the same class
#undef private

  Jerome.




  parent reply	other threads:[~1996-02-20  0:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-02-20  0:00 on OO differnces between Ada95 and C++ Nasser Abbasi
1996-02-20  0:00 ` Robert I. Eachus
1996-02-20  0:00 ` Norman H. Cohen
1996-02-21  0:00   ` Mark A Biggar
1996-02-22  0:00     ` Norman H. Cohen
1996-02-27  0:00   ` Adam Morris
1996-02-20  0:00 ` Jerome Desquilbet [this message]
1996-02-21  0:00   ` Robert Dewar
1996-02-22  0:00     ` Jerome Desquilbet
1996-02-24  0:00       ` Robert Dewar
1996-02-22  0:00   ` Pete Becker
1996-02-23  0:00     ` Jerome Desquilbet
1996-02-26  0:00     ` Darren C Davenport
1996-02-26  0:00       ` Pete Becker
1996-02-27  0:00         ` Nigel Perry
1996-02-21  0:00 ` Jon S Anthony
1996-02-21  0:00 ` John English
1996-02-22  0:00   ` Gene Ouye
1996-02-26  0:00     ` John English
1996-02-22  0:00   ` Nasser Abbasi
1996-02-26  0:00     ` John English
1996-02-27  0:00       ` Dale Stanbrough
1996-02-21  0:00 ` Darren C Davenport
  -- strict thread matches above, loose matches on Subject: below --
1996-02-21  0:00 Christian Jaensch, FRG
1996-02-26  0:00 Simon Johnston
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox