From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: begin clause in package bodies Date: Fri, 1 Dec 2017 16:26:40 -0600 Organization: JSA Research & Innovation Message-ID: References: <4c77317b-6d12-474f-928d-c713501f647a@googlegroups.com><7732b88c-5911-4857-a9c8-e5a719043b26@googlegroups.com> Injection-Date: Fri, 1 Dec 2017 22:26:41 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="10604"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:49315 Date: 2017-12-01T16:26:40-06:00 List-Id: "Simon Wright" 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.