comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: begin clause in package bodies
Date: Fri, 1 Dec 2017 16:26:40 -0600
Date: 2017-12-01T16:26:40-06:00	[thread overview]
Message-ID: <ovskv1$abc$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: ly8tembijz.fsf@pushface.org

"Simon Wright" <simon@pushface.org> wrote in message 
news:ly8tembijz.fsf@pushface.org...
> Mehdi Saada <00120260a@gmail.com> writes:
>
>> I read using package with internal states or global variable was bad,
>> regards to hiding implementation details, further development and
>> concurrent programming.
>
> This seems to be very wrong advice. Do you have a reference?

Isn't it just confused rather than wrong? A package with an internal state 
can't safely be used concurrently unless that state is synchronized somehow, 
which is expensive. OTOH, most packages don't need to be used concurrently, 
and in that case, hiding internal states is way better than leaving the 
state open for anyone to mess with. (One problem is telling these two sorts 
of packages apart, something that hopefully Ada 2020 will help with using 
its Global aspect.)

                              Randy.



  parent reply	other threads:[~2017-12-01 22:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30 23:28 begin clause in package bodies Mehdi Saada
2017-12-01  0:09 ` Anh Vo
2017-12-01 10:54 ` Jeffrey R. Carter
2017-12-01 13:05 ` Mehdi Saada
2017-12-01 13:20   ` Dmitry A. Kazakov
2017-12-01 14:59   ` Simon Wright
2017-12-01 15:15     ` Mehdi Saada
2017-12-01 15:52       ` Dmitry A. Kazakov
2017-12-01 22:23         ` Randy Brukardt
2017-12-01 22:26     ` Randy Brukardt [this message]
2017-12-01 16:29   ` Jeffrey R. Carter
replies disabled

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