comp.lang.ada
 help / color / mirror / Atom feed
From: Richard Riehle <laoXhai@ix.netcom.com>
Subject: Re: exiting a bloc
Date: Tue, 05 Sep 2000 10:52:11 -0700
Date: 2000-09-05T18:04:45+00:00	[thread overview]
Message-ID: <39B532CB.73D359F8@ix.netcom.com> (raw)
In-Reply-To: 8orprn$b46$1@nnrp1.deja.com



Robert Dewar wrote:

in response to article article <39B15EA8.88DB58AB@netcourrier.com>
                 by Mathias Dolidon <matd@netcourrier.com>:

> THe obvious answer is that a goto could be used, however, it is
> almost certain that if we saw the entire code we would suggest
> some other method. In particular, it is not at all clear why
> you are using a block at all, it appears useless but of course
> we do not have your entire code.

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.

His point-of-view evolved over many years of watching declare blocks
grow to cover several
pages,  become more convulted with the nesting of additional declare
blocks during program
maintenance, and transmogrify into long passages of increasingly
unreadable code.   It seems
the declare block may be something akin to the Q&D programs we used to
write (waddaya
mean "used to", cries the chorus) where sloppy coding style was OK
because the program
was "small and no one would ever want to used it again anyway."

So, are declare blocks, echoing the ancient Jeremiad of Dijkstra,
"considered dangerous" ?

Richard Riehle




  parent reply	other threads:[~2000-09-05 17:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-02 20:10 exiting a bloc Mathias Dolidon
2000-09-02 20:39 ` Mathias Dolidon
2000-09-02 21:01 ` Robert Dewar
2000-09-02 22:34   ` Mathias Dolidon
     [not found]     ` <86snrhkfep.fsf@acm.org>
2000-09-03 15:46       ` Mathias Dolidon
2000-09-05 17:52   ` Richard Riehle [this message]
2000-09-06  2:06     ` Ted Dennison
2000-09-06  9:41       ` Philip Anderson
2000-09-06 13:54         ` Ted Dennison
2000-09-06 21:10           ` Robert Dewar
2000-09-06 23:33             ` Ed Falis
2000-09-07  0:39               ` Robert Dewar
     [not found]               ` <39B72109.89DFAB8C@telepath.com>
2000-09-07 12:34                 ` Ed Falis
2000-09-08 10:33                   ` Ian Caldwell
2000-09-08 13:35                     ` r_c_chapman
2000-09-09  1:52                       ` Robert Dewar
2000-09-12 11:30                       ` Ian Caldwell
2000-09-12 20:13                         ` Robert Dewar
2000-09-09  1:48                     ` Robert Dewar
2000-09-12 11:24                       ` Ian Caldwell
2000-09-12 20:14                         ` Robert Dewar
2000-09-13  8:34                           ` Philip Anderson
2000-09-13 11:02                             ` Peter Amey
2000-09-06  7:00     ` Ray Blaak
replies disabled

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