comp.lang.ada
 help / color / mirror / Atom feed
From: jgg@evb.com (John Goodsen)
Subject: Re: Encapsulation in Ada vs. C++ (Was Re: Ichibah [sic] ...)
Date: Tue, 16 Mar 1993 22:37:08 GMT
Date: 1993-03-16T22:37:08+00:00	[thread overview]
Message-ID: <1993Mar16.223708.11893@evb.com> (raw)

magnus@lglsun.epfl.ch (Magnus Kempe) writes:
>
>If your class Foo grants "friendship" to a function/class Bar, _anyone_
>can write such a function/class and, having granted itself "friendliness",
>will have access to the internals of Foo.
>
Oh my!  And shame, shame, shame on you for even thinking imitating
my "BAR".  This argument is remeniscent of the facist arguments which
have the common theme of "you might use it wrong, therefore I want
to keep you from using it at all".  BTW, you won't get too far in
the link stage with both "BAR"s in the system (multiply defined identifiers
and such..)

>
>To repeat: contrary to Ada, C++ does not provide a safe means to create
>subprograms acting on parameters of two or more types (classes).  In
>C++, either you write an unsafe class because the language lacks the
>concept of a module, or you twist around with .h files and say good-bye
>to limited, separate recompilations.
>

"UNSAFE CLASS" ???
Huh?  Come now!  "friendship" is not necessarily unsafe.  Only if you use
it wrong.  True, Ada packaging and "classtypes" (I refuse to use
tagged type syntax anymore ;-) overcome this *perceived* defect
in C++, but to *twist* the truth in suggesting that you lose separate
recompilations is not responsible.  In fact to the contrary, the *friend*
concept allows for separate recompilation of these related classes
and functions.  Ada packages *REQUIRE* recompilation of all related 
"classtypes" (there it is again, isn't it a pretty syntax ;-), since they're
in the same package.  


-- 
John Goodsen
Software Process & Environments
EVB Software Engineering
jgg@evb.com



             reply	other threads:[~1993-03-16 22:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-03-16 22:37 John Goodsen [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-03-07 19:15 Ichibah flames, and flames out over, Ada 9X John Goodsen
1993-03-08 15:36 ` Tucker Taft
1993-03-09 18:12   ` Tom Wicklund
1993-03-11  8:04     ` Encapsulation in Ada vs. C++ (Was Re: Ichibah [sic] ...) Magnus Kempe
1993-03-16  6:34       ` Dag Bruck
1993-03-16  7:51         ` Magnus Kempe
1993-03-16  9:51           ` Dag Bruck
replies disabled

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