comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Package Instances???
Date: Thu, 21 Feb 2002 09:05:47 -0500
Date: 2002-02-21T14:05:49+00:00	[thread overview]
Message-ID: <a52urt$qhg$1@nh.pace.co.uk> (raw)
In-Reply-To: 3C7487D6.5060603@mail.com

But why fight it? When programming in C++, the fundamental idiom is the
class - maybe with a namespace around it to isolate the identifiers &
produce better encapsulation. When programming in Ada, the fundamental idiom
is the package - which gives you encapsulation and lots of other cool
stuff - but isn't an "object" or a "type" so it can't really do what a C++
class does. It needs to contain a tagged type to complete the picture.

I don't think that C++ really has an analog for what Ada does with a
package - at least nothing that provides anything resembling a mirror image.
It has things that will give you some of the features of a package - but
because it carries so much legacy from C the whole concept of what Ada does
with a package is rather foreign and it would be difficult to add something
to C++ that would create a "package" and still maintaining upward
compatibility.

I think Ada's packages are a big advantage and a good reason to do things in
Ada instead of C++ (or C, for that matter). The encapsulation, separation of
interface and implementation and information hiding alone is worth it. You
can get something similar out of C++, sort of, if you work at it, but it
always seemed to me to be something you had to cobble together out of spare
parts in a junk drawer rather than something that was inherently engineered
into the language.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Hyman Rosen" <hyrosen@mail.com> wrote in message
news:3C7487D6.5060603@mail.com...
>
> But my purpose isn't to implement a type, it's to find a C++ analogue
> for Ada packages. C++ namespaces are useless for anything except what
> the name implies, namely establishing a namespace.
>





  reply	other threads:[~2002-02-21 14:05 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-13 21:02 Package Instances??? Yates
2002-02-13 21:12 ` Larry Kilgallen
2002-02-13 21:21 ` chris.danx
2002-02-13 21:46 ` Marin David Condic
2002-02-14 17:59   ` Hyman Rosen
2002-02-15 13:11     ` Marc A. Criley
2002-02-15 19:20     ` Simon Wright
2002-02-19 14:08       ` Marin David Condic
2002-02-20  1:37         ` Matthew Heaney
2002-02-20 16:56           ` Marin David Condic
2002-02-21 15:33             ` Matthew Heaney
2002-02-20 19:16           ` Hyman Rosen
2002-02-20 22:31             ` Pat Rogers
2002-02-20 23:44             ` Matthew Heaney
2002-02-21  5:35               ` Hyman Rosen
2002-02-21 14:05                 ` Marin David Condic [this message]
2002-02-22 16:49                   ` Hyman Rosen
2002-02-22 17:22                     ` Marin David Condic
2002-02-24  7:39                       ` Hyman Rosen
2002-02-25 15:38                         ` Matthew Heaney
2002-02-22 18:10                     ` Matthew Heaney
2002-02-22 20:55                       ` Hyman Rosen
2002-02-22 21:37                         ` Matthew Heaney
2002-02-24  7:36                           ` Hyman Rosen
2002-02-25 15:27                             ` Matthew Heaney
2002-02-21 15:30                 ` Matthew Heaney
2002-02-21 18:05                   ` Hyman Rosen
2002-02-13 21:50 ` Eric Merritt
2002-02-14 15:08 ` Yates
replies disabled

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