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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7d1a6bfc6489c17b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-09-05 19:06:59 PST Path: supernews.google.com!sn-xit-02!sn-east!sn-xit-03!supernews.com!cyclone-sf.pbi.net!209.81.14.120!feeder.via.net!209.249.123.233.MISMATCH!xfer10.netnews.com!netnews.com!newspeer1.nac.net!yellow.newsread.com!netaxs.com!newsread.com!POSTED.newshog.newsread.com!not-for-mail Message-ID: <39B5A8B0.56D674C6@telepath.com> From: Ted Dennison X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en,pdf MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: exiting a bloc References: <39B15EA8.88DB58AB@netcourrier.com> <8orprn$b46$1@nnrp1.deja.com> <39B532CB.73D359F8@ix.netcom.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 06 Sep 2000 02:06:37 GMT NNTP-Posting-Host: 38.195.186.125 X-Complaints-To: Abuse Role , We Care X-Trace: newshog.newsread.com 968205997 38.195.186.125 (Tue, 05 Sep 2000 22:06:37 EDT) NNTP-Posting-Date: Tue, 05 Sep 2000 22:06:37 EDT Organization: Telepath Systems (telepath.com) Xref: supernews.google.com comp.lang.ada:508 Date: 2000-09-06T02:06:37+00:00 List-Id: Richard Riehle wrote: > Robert Dewar wrote: > > This raises another interesting question regarding Ada design style. I > know of one manager > with responsibility for embedded Ada software who prohibits declare > blocks in the code. > In his mind, a declare block is an ad hoc construct that demonstrates > insufficient attention > to the overall design. In particular, when one is tempted to code a > declare block, he insists > it be promoted to a nested procedure accompanied, if necessary, by a > pragma Inline. I know I pretty much follow that rule myself. But I'm not sure I'd like to see it elevated to Law. I do occasionaly like to use "declare" for sizing arrays (particularly strings) dynamicly on the stack. I think I've also used them in the "accept" alternatives of server tasks or in branches of large command-processing case statements to declare local variables that are unique to that alternative. About the only other reason I ever use a declare is to declare local variables that are used in the exception code of a block's exception handler. It'd be a bit excessive to create a new routine just because the exception handler needs a variable. It makes sense to limit the variable's scope to the block, since that's the only place its used and the block is already there. -- T.E.D. Home - mailto:dennison@telepath.com Work - mailto:dennison@ssd.fsi.com WWW - http://www.telepath.com/dennison/Ted/TED.html ICQ - 10545591