From: Richard D Riehle <laoXhai@ix.netcom.com>
Subject: Re: A question for my personal knowledge.
Date: 1999/05/18
Date: 1999-05-18T13:07:12-07:00 [thread overview]
Message-ID: <7hsh9g$rjp@sjx-ixn4.ix.netcom.com> (raw)
In-Reply-To: t7yaimcpdi.fsf@calumny.jyacc.com
In article <t7yaimcpdi.fsf@calumny.jyacc.com>,
Hyman Rosen <hymie@prolifics.com> wrote:
>Richard D Riehle <laoXhai@ix.netcom.com> writes:
>> For example, a properly designed C++ class requires at least one
>> constructor, a copy constructor, overloading of assignment, and a
>> destructor.
>
>That is completely untrue, if you mean that the programmer must supply
>those methods, since the compiler will write all of these for you if
>you don't write them yourself. You only need your own if the default
>ones are not suitable for your purposes. But for those cases, you would
>have to do the same in Ada, I imagine.
While it is true that a C++ compiler may create _all_ of these for
you, it would be a rare class where there was no constructor defined
in the public part. I have seen C++ classes where no constructor
was defined in which the constructor was inherited from an ancestral
class. Not common. Destructors are more often defaulted to the one
created by the compiler. This is sometimes the source of an error
in the design of a class. An even more interesting source of errors
is the failure to create a copy constructor or overload assignment.
You are correct that the compiler will create these for you. The
question is when to create your own instead of accepting the default
created by the compiler. The answer to this question is often non-trivial.
In Ada, a creation of an object is a simple declaration. Since Ada
allows initialization of object components, no initializor list is
required, unless the type has a discriminant. An Ada designer has
some options not available to the C++ programmer when choosing which
level of abstraction to incorporate into a design. A prolonged
discussion of these is beyond the scope of a short note on this forum.
I wonder if the closing words of your reply, "I imagine," suggest
that further study of Ada would illuminate some of the points better
than I could do in this brief space.
As to comparing the languages, such comparisons are nearly always
fruitless. People have their preferences. They will find whatever
features, syntax, and semantic horseradish that best supports their
personal point-of-view. This is as true of me as it no doubt is of
you. I use both languages, Ada and C++. My personal preference is
Ada. I find it better suited to complex design of large-scale safety
critical software. Perhaps my preference is a function of unbridled
bigotry. So be it. But I have taken the trouble to study and use
both languages, so I think my bigotry is softened by my experience.
Have you taken the trouble to study Ada?
Richard Riehle
richard@adaworks.com
http://www.adaworks.com
next prev parent reply other threads:[~1999-05-18 0:00 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-05-10 0:00 A question for my personal knowledge Siamak Kaveh
1999-05-10 0:00 ` Larry Kilgallen
1999-05-10 0:00 ` Keith Thompson
1999-05-12 0:00 ` Charlie McCutcheon
1999-05-12 0:00 ` Werner Pachler
1999-05-17 0:00 ` Charlie McCutcheon
1999-05-17 0:00 ` bglbv
1999-05-17 0:00 ` Larry Kilgallen
1999-05-18 0:00 ` bglbv
1999-05-19 0:00 ` Larry Kilgallen
1999-05-10 0:00 ` Sam
1999-05-10 0:00 ` Roy Grimm
1999-05-11 0:00 ` Pascal Obry
1999-05-11 0:00 ` Roy Grimm
1999-05-11 0:00 ` Robert Dewar
1999-05-11 0:00 ` dennison
1999-05-13 0:00 ` Mike Yoder
1999-05-13 0:00 ` Mike
1999-05-13 0:00 ` Martin C. Carlisle
1999-05-14 0:00 ` Dale Stanbrough
1999-05-13 0:00 ` Mike
1999-05-13 0:00 ` Brian Rogoff
1999-05-13 0:00 ` David Starner
1999-05-18 0:00 ` Georg Bauhaus
1999-05-14 0:00 ` Florian Weimer
1999-05-14 0:00 ` Steve
1999-05-15 0:00 ` Florian Weimer
1999-05-15 0:00 ` Matthew Heaney
1999-05-14 0:00 ` Dale Stanbrough
1999-05-15 0:00 ` Matthew Heaney
1999-05-18 0:00 ` Richard D Riehle
1999-05-18 0:00 ` Hyman Rosen
1999-05-18 0:00 ` Richard D Riehle [this message]
1999-05-18 0:00 ` Hyman Rosen
1999-05-19 0:00 ` Richard D Riehle
1999-05-11 0:00 ` Roy Grimm
1999-05-12 0:00 ` Robert A Duff
1999-05-11 0:00 ` Marin David Condic
1999-05-11 0:00 ` Roy Grimm
1999-05-11 0:00 ` Tucker Taft
1999-05-11 0:00 ` Roy Grimm
1999-05-12 0:00 ` Roger Racine
1999-05-12 0:00 ` Marin David Condic
1999-05-17 0:00 ` Richard D Riehle
1999-05-18 0:00 ` Marin David Condic
1999-05-18 0:00 ` bglbv
1999-05-18 0:00 ` William B. Clodius
1999-05-17 0:00 ` Charlie McCutcheon
1999-05-17 0:00 ` Larry Kilgallen
1999-05-17 0:00 ` Chris
1999-05-17 0:00 ` Marin David Condic
1999-05-17 0:00 ` Marin David Condic
1999-05-10 0:00 ` Marin David Condic
1999-05-10 0:00 ` Paul Whittington
1999-05-10 0:00 ` Marin David Condic
1999-05-10 0:00 ` Dan Nagle
1999-05-11 0:00 ` Jean-Pierre Rosen
1999-05-11 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox